Leaving a room creates a stuck "leaving room" loading screen. (#1041)
This commit is contained in:
parent
198e23c204
commit
3f9a5a4e54
|
@ -16,6 +16,7 @@ Bugfix 🐛:
|
|||
- Fix crash in the room directory, when public room has no name (#1023)
|
||||
- Fix restoring keys backup with passphrase (#526)
|
||||
- Fix joining rooms from directory via federation isn't working. (#808)
|
||||
- Leaving a room creates a stuck "leaving room" loading screen. (#1041)
|
||||
|
||||
Translations 🗣:
|
||||
-
|
||||
|
|
|
@ -105,6 +105,7 @@ class RoomListFragment @Inject constructor(
|
|||
is RoomListViewEvents.Loading -> showLoading(it.message)
|
||||
is RoomListViewEvents.Failure -> showFailure(it.throwable)
|
||||
is RoomListViewEvents.SelectRoom -> handleSelectRoom(it)
|
||||
is RoomListViewEvents.Done -> Unit
|
||||
}.exhaustive
|
||||
}
|
||||
|
||||
|
|
|
@ -28,4 +28,5 @@ sealed class RoomListViewEvents : VectorViewEvents {
|
|||
data class Failure(val throwable: Throwable) : RoomListViewEvents()
|
||||
|
||||
data class SelectRoom(val roomSummary: RoomSummary) : RoomListViewEvents()
|
||||
object Done : RoomListViewEvents()
|
||||
}
|
||||
|
|
|
@ -197,6 +197,10 @@ class RoomListViewModel @Inject constructor(initialState: RoomListViewState,
|
|||
private fun handleLeaveRoom(action: RoomListAction.LeaveRoom) {
|
||||
_viewEvents.post(RoomListViewEvents.Loading(null))
|
||||
session.getRoom(action.roomId)?.leave(null, object : MatrixCallback<Unit> {
|
||||
override fun onSuccess(data: Unit) {
|
||||
_viewEvents.post(RoomListViewEvents.Done)
|
||||
}
|
||||
|
||||
override fun onFailure(failure: Throwable) {
|
||||
_viewEvents.post(RoomListViewEvents.Failure(failure))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue