fix channelpreview with messagelistempty
This commit is contained in:
@@ -1 +1 @@
|
|||||||
13a41b8138c4868054e44b5158f3bdd6
|
c770358a10272b4ee1cdc2eb432445f6
|
||||||
@@ -127,7 +127,7 @@ class ChannelListPage extends StatelessWidget {
|
|||||||
'\$in': [StreamChat.of(context).user.id],
|
'\$in': [StreamChat.of(context).user.id],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sort: [SortOption('last_message_at')],
|
// sort: [SortOption('last_message_at')],
|
||||||
pagination: PaginationParams(
|
pagination: PaginationParams(
|
||||||
limit: 20,
|
limit: 20,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -128,7 +128,10 @@ class ChannelPreview extends StatelessWidget {
|
|||||||
stream: channel.state.messagesStream,
|
stream: channel.state.messagesStream,
|
||||||
initialData: channel.state.messages,
|
initialData: channel.state.messages,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
final lastMessage = snapshot.data?.lastWhere((m) => m.shadowed != true);
|
final lastMessage = snapshot.data?.lastWhere(
|
||||||
|
(m) => m.shadowed != true,
|
||||||
|
orElse: () => null,
|
||||||
|
);
|
||||||
if (lastMessage == null) {
|
if (lastMessage == null) {
|
||||||
return SizedBox();
|
return SizedBox();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user