mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 23:25:20 +03:00
ensure that there is always a current user
this should also fix the app to start after it always crashed on startup because of https://github.com/nextcloud/talk-android/issues/2531 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
dd155db6ab
commit
e238c4c9e5
2 changed files with 2 additions and 1 deletions
|
@ -295,7 +295,7 @@ class ConversationsListController(bundle: Bundle) :
|
||||||
}
|
}
|
||||||
fetchRooms()
|
fetchRooms()
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "currentUser was null in ConversationsListController.onAttach")
|
Log.e(TAG, "userManager.currentUser.blockingGet() returned null")
|
||||||
Toast.makeText(context, R.string.nc_common_error_sorry, Toast.LENGTH_LONG).show()
|
Toast.makeText(context, R.string.nc_common_error_sorry, Toast.LENGTH_LONG).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ class UserManager internal constructor(private val userRepository: UsersReposito
|
||||||
val currentUser: Maybe<User>
|
val currentUser: Maybe<User>
|
||||||
get() {
|
get() {
|
||||||
return userRepository.getActiveUser()
|
return userRepository.getActiveUser()
|
||||||
|
.switchIfEmpty(getAnyUserAndSetAsActive())
|
||||||
}
|
}
|
||||||
|
|
||||||
val currentUserObservable: Observable<User>
|
val currentUserObservable: Observable<User>
|
||||||
|
|
Loading…
Reference in a new issue