Fixed issue with message received & dislay in a chat room for which the sliding pane was closed but fragment wasn't paused or destroyed

This commit is contained in:
Sylvain Berfini 2022-01-04 11:37:52 +01:00
parent 0404777c32
commit fc6792687c

View file

@ -255,7 +255,7 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
override fun onScrolledToEnd() {
viewModel.isUserScrollingUp.value = false
if (viewModel.unreadMessagesCount.value != 0) {
if (viewModel.unreadMessagesCount.value != 0 && coreContext.notificationsManager.currentlyDisplayedChatRoomAddress != null) {
Log.i("[Chat Room] User has scrolled to the latest message, mark chat room as read")
viewModel.chatRoom.markAsRead()
}
@ -649,6 +649,7 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
}
override fun goBack() {
coreContext.notificationsManager.currentlyDisplayedChatRoomAddress = null
if (!findNavController().popBackStack()) {
if (sharedViewModel.isSlidingPaneSlideable.value == true) {
if (_adapter != null) {