🐛 Fix message history display latency

This commit is contained in:
LittleSheep 2024-06-24 22:25:17 +08:00
parent 7034ff80db
commit 7c35323279

View File

@ -18,9 +18,13 @@ class ChatHistoryController {
} }
Future<void> getMessages(Channel channel, String scope) async { Future<void> getMessages(Channel channel, String scope) async {
syncHistory(channel);
isLoading.value = true; isLoading.value = true;
totalHistoryCount.value = totalHistoryCount.value = await database.syncMessages(
await database.syncMessages(channel, scope: scope); channel,
scope: scope,
);
await syncHistory(channel); await syncHistory(channel);
isLoading.value = false; isLoading.value = false;
} }