mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 14:32:37 +01:00
chore: Remove unnecessary stream subscriptions
This commit is contained in:
parent
5b96bfd83a
commit
874da53684
@ -88,12 +88,6 @@ class StoriesHeader extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final client = Matrix.of(context).client;
|
||||
return StreamBuilder(
|
||||
stream: Matrix.of(context).onShareContentChanged.stream,
|
||||
builder: (context, _) => StreamBuilder<Object>(
|
||||
stream: client.onSync.stream
|
||||
.where((syncUpdate) => syncUpdate.hasRoomUpdate),
|
||||
builder: (context, snapshot) {
|
||||
if (Matrix.of(context).shareContent != null) {
|
||||
return ListTile(
|
||||
leading: CircleAvatar(
|
||||
@ -107,9 +101,8 @@ class StoriesHeader extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
if (client.storiesRooms.isEmpty ||
|
||||
!client.storiesRooms.any((room) => room.displayname
|
||||
.toLowerCase()
|
||||
.contains(filter.toLowerCase()))) {
|
||||
!client.storiesRooms.any((room) =>
|
||||
room.displayname.toLowerCase().contains(filter.toLowerCase()))) {
|
||||
return Container();
|
||||
}
|
||||
final ownStoryRoom = client.storiesRooms
|
||||
@ -134,9 +127,7 @@ class StoriesHeader extends StatelessWidget {
|
||||
userId?.localpart ??
|
||||
'Unknown';
|
||||
final avatarUrl = snapshot.data?.avatarUrl;
|
||||
if (!displayname
|
||||
.toLowerCase()
|
||||
.contains(filter.toLowerCase())) {
|
||||
if (!displayname.toLowerCase().contains(filter.toLowerCase())) {
|
||||
return Container();
|
||||
}
|
||||
return _StoryButton(
|
||||
@ -151,15 +142,12 @@ class StoriesHeader extends StatelessWidget {
|
||||
unread: room.membership == Membership.invite ||
|
||||
(room.hasNewMessages && room.hasPosts),
|
||||
onPressed: () => _goToStoryAction(context, room.id),
|
||||
onLongPressed: () =>
|
||||
_contextualActions(context, room),
|
||||
onLongPressed: () => _contextualActions(context, room),
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user