From 7c35323279ffaf905f81dc78723f0b19c036436c Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 24 Jun 2024 22:25:17 +0800 Subject: [PATCH] :bug: Fix message history display latency --- lib/controllers/chat_history_controller.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/controllers/chat_history_controller.dart b/lib/controllers/chat_history_controller.dart index 0d93047..94b671e 100644 --- a/lib/controllers/chat_history_controller.dart +++ b/lib/controllers/chat_history_controller.dart @@ -18,9 +18,13 @@ class ChatHistoryController { } Future getMessages(Channel channel, String scope) async { + syncHistory(channel); + isLoading.value = true; - totalHistoryCount.value = - await database.syncMessages(channel, scope: scope); + totalHistoryCount.value = await database.syncMessages( + channel, + scope: scope, + ); await syncHistory(channel); isLoading.value = false; }