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

View File

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