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