Set pages to be every 50 messages

Large enough to prevent onLoadMore from calling refresh on a few messages, but small enough to refresh when needed.

Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
This commit is contained in:
Julius Linus 2024-04-16 09:13:15 -05:00 committed by Marcel Hibbe
parent 188aed721d
commit 57017f95f4
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B

View file

@ -3968,7 +3968,7 @@ class ChatActivity :
} }
override fun onLoadMore(page: Int, totalItemsCount: Int) { override fun onLoadMore(page: Int, totalItemsCount: Int) {
val calculatedPage = page / MESSAGE_PULL_LIMIT val calculatedPage = totalItemsCount / PAGE_SIZE
if (calculatedPage > 0) { if (calculatedPage > 0) {
chatViewModel.refreshChatParams( chatViewModel.refreshChatParams(
setupFieldsForPullChatMessages( setupFieldsForPullChatMessages(
@ -4991,5 +4991,6 @@ class ChatActivity :
private const val CURRENT_AUDIO_POSITION_KEY = "CURRENT_AUDIO_POSITION" private const val CURRENT_AUDIO_POSITION_KEY = "CURRENT_AUDIO_POSITION"
private const val CURRENT_AUDIO_WAS_PLAYING_KEY = "CURRENT_AUDIO_PLAYING" private const val CURRENT_AUDIO_WAS_PLAYING_KEY = "CURRENT_AUDIO_PLAYING"
private const val RESUME_AUDIO_TAG = "RESUME_AUDIO_TAG" private const val RESUME_AUDIO_TAG = "RESUME_AUDIO_TAG"
private const val PAGE_SIZE = 50
} }
} }