fix(chat): disable unusable history pagination (#676)

When the initial REST page returns empty messages, hasOlderMessages
was still set to true (offset > 0), causing an infinite loop of empty
load-more requests. Guard with && chatMessages.isNotEmpty().

Co-authored-by: M57 <Hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-07-22 12:09:29 +03:00
1 parent 0edb67338d
commit 56de3323f0
2 files changed
+50 -1

No files matched your search

@@ -1403,7 +1403,7 @@ class ChatViewModel(
state.copy(
messages = chatMessages,
isLoading = false,
hasOlderMessages = offset > 0,
hasOlderMessages = offset > 0 && chatMessages.isNotEmpty(),
isLoadingOlder = false,
)
}