Fixed new chat messages not displayed automatically in chat room if opened while some existing were unread

This commit is contained in:
Sylvain Berfini 2022-08-24 09:59:46 +02:00
parent d1b615beec
commit db01f7a006

View file

@ -762,6 +762,8 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
if (notAllMessagesDisplayed) {
Log.w("[Chat Room] More unread messages than the screen can display, do not mark chat room as read now, wait for user to scroll to bottom")
} else {
// Consider user as scrolled to the end when marking chat room as read
viewModel.isUserScrollingUp.value = false
Log.i("[Chat Room] Marking chat room as read")
viewModel.chatRoom.markAsRead()
}