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:
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,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user