Error handling
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
This commit is contained in:
parent
f8718e397c
commit
42166c1c0f
|
@ -182,7 +182,10 @@ class RoomDetailViewModel @AssistedInject constructor(
|
||||||
updateShowDialerOptionState()
|
updateShowDialerOptionState()
|
||||||
room.getRoomSummaryLive()
|
room.getRoomSummaryLive()
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT)
|
try {
|
||||||
|
room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT)
|
||||||
|
} catch (_: Exception) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Inform the SDK that the room is displayed
|
// Inform the SDK that the room is displayed
|
||||||
session.onRoomDisplayed(initialState.roomId)
|
session.onRoomDisplayed(initialState.roomId)
|
||||||
|
@ -549,7 +552,10 @@ class RoomDetailViewModel @AssistedInject constructor(
|
||||||
if (trackUnreadMessages.getAndSet(false)) {
|
if (trackUnreadMessages.getAndSet(false)) {
|
||||||
mostRecentDisplayedEvent?.root?.eventId?.also {
|
mostRecentDisplayedEvent?.root?.eventId?.also {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
room.setReadMarker(it)
|
try {
|
||||||
|
room.setReadMarker(it)
|
||||||
|
} catch (_: Exception) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mostRecentDisplayedEvent = null
|
mostRecentDisplayedEvent = null
|
||||||
|
@ -1262,7 +1268,10 @@ class RoomDetailViewModel @AssistedInject constructor(
|
||||||
|
|
||||||
private fun handleMarkAllAsRead() {
|
private fun handleMarkAllAsRead() {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
room.markAsRead(ReadService.MarkAsReadParams.BOTH)
|
try {
|
||||||
|
room.markAsRead(ReadService.MarkAsReadParams.BOTH)
|
||||||
|
} catch (_: Exception) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,10 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
||||||
val room = session.getRoom(roomId)
|
val room = session.getRoom(roomId)
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
GlobalScope.launch {
|
GlobalScope.launch {
|
||||||
room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT)
|
try {
|
||||||
|
room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT)
|
||||||
|
} catch (_: Exception) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue