fix bug on empty thread

This commit is contained in:
Salvatore Giordano
2020-03-13 15:44:25 +01:00
parent 18765f9823
commit 2f6143234a
2 changed files with 6 additions and 5 deletions
+6 -4
View File
@@ -329,10 +329,12 @@ class _MessageListViewState extends State<MessageListView> {
} }
_streamListener = stream _streamListener = stream
.map((messages) => messages .map((messages) =>
.where((m) => messages
!(m.status == MessageSendingStatus.FAILED && m.isDeleted)) ?.where((m) =>
.toList()) !(m.status == MessageSendingStatus.FAILED && m.isDeleted))
?.toList() ??
[])
.listen((newMessages) { .listen((newMessages) {
newMessages = newMessages.reversed.toList(); newMessages = newMessages.reversed.toList();
if (_messages.isEmpty || if (_messages.isEmpty ||
-1
View File
@@ -76,7 +76,6 @@ class StreamChannelState extends State<StreamChannel> {
/// Calls [channel.getReplies] updating [queryMessage] stream /// Calls [channel.getReplies] updating [queryMessage] stream
Future<void> getReplies(String parentId) async { Future<void> getReplies(String parentId) async {
_queryMessageController.add(true); _queryMessageController.add(true);
print('PARENT $parentId');
String firstId; String firstId;
if (widget.channel.state.threads.containsKey(parentId)) { if (widget.channel.state.threads.containsKey(parentId)) {