forked from GitHub-Mirror/riotX-android
Home : don't open the room if it doesn't exist. Just a workaround at the moment, need to think more about that.
This commit is contained in:
parent
68b9ba7b99
commit
a5032920c2
@ -52,11 +52,11 @@ class HomeActivityViewModel(state: EmptyState,
|
|||||||
get() = _openRoomLiveData
|
get() = _openRoomLiveData
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val lastSelectedRoom = roomSelectionRepository.lastSelectedRoom()
|
val lastSelectedRoomId = roomSelectionRepository.lastSelectedRoom()
|
||||||
if (lastSelectedRoom == null) {
|
if (lastSelectedRoomId == null || session.getRoom(lastSelectedRoomId) == null) {
|
||||||
getTheFirstRoomWhenAvailable()
|
getTheFirstRoomWhenAvailable()
|
||||||
} else {
|
} else {
|
||||||
_openRoomLiveData.postValue(LiveEvent(lastSelectedRoom))
|
_openRoomLiveData.postValue(LiveEvent(lastSelectedRoomId))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user