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
|
||||
|
||||
init {
|
||||
val lastSelectedRoom = roomSelectionRepository.lastSelectedRoom()
|
||||
if (lastSelectedRoom == null) {
|
||||
val lastSelectedRoomId = roomSelectionRepository.lastSelectedRoom()
|
||||
if (lastSelectedRoomId == null || session.getRoom(lastSelectedRoomId) == null) {
|
||||
getTheFirstRoomWhenAvailable()
|
||||
} else {
|
||||
_openRoomLiveData.postValue(LiveEvent(lastSelectedRoom))
|
||||
_openRoomLiveData.postValue(LiveEvent(lastSelectedRoomId))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user