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:
ganfra 2019-02-01 12:32:43 +01:00
parent 68b9ba7b99
commit a5032920c2
1 changed files with 3 additions and 3 deletions

View File

@ -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))
}
}