mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-18 18:33:49 +02:00
fix(chat-service): sort combined streams
This commit is contained in:
parent
6fbe1e67d2
commit
03ea20aa6a
1 changed files with 3 additions and 1 deletions
|
@ -157,7 +157,9 @@ class ChatService {
|
|||
...Map.fromEntries(
|
||||
messages.map((message) => MapEntry(message.id, message)),
|
||||
),
|
||||
}.values.toList();
|
||||
}.values.toList().sorted(
|
||||
(a, b) => a.timestamp.compareTo(b.timestamp),
|
||||
);
|
||||
|
||||
return Rx.combineLatest2(
|
||||
chatRepository.getMessages(userId: userId, chatId: chatId),
|
||||
|
|
Loading…
Reference in a new issue