Fix removing unread marker automatically when opening chats at unread

Change-Id: I0ff265fb72df4f6d21e4048d0e6667be882d5882
This commit is contained in:
SpiritCroc 2021-08-05 09:20:58 +02:00
parent daad03bc89
commit c6c38a4d75
1 changed files with 4 additions and 2 deletions

View File

@ -189,9 +189,11 @@ class RoomDetailViewModel @AssistedInject constructor(
observeActiveRoomWidgets() observeActiveRoomWidgets()
observePowerLevel() observePowerLevel()
room.getRoomSummaryLive() room.getRoomSummaryLive()
if (!vectorPreferences.loadRoomAtFirstUnread()) { viewModelScope.launch(Dispatchers.IO) {
viewModelScope.launch(Dispatchers.IO) { if (!vectorPreferences.loadRoomAtFirstUnread()) {
tryOrNull { room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT) } tryOrNull { room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT) }
} else {
tryOrNull { room.setMarkedUnread(false) }
} }
} }
// Inform the SDK that the room is displayed // Inform the SDK that the room is displayed