mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
fix to load conversationlist only once after login
without this fix: after login the conversation list opened multiple times for the same user when other users already exist reason: proceedWithLogin() in AccountVerificationController is called multiple times because for ALL accounts (for (User user : userEntityObjectList)) the workers send their results via eventBus to AccountVerificationController#onMessageEvent(eventStatus: EventStatus) So depending on how many accounts exist, the ConversationList was loaded x times. solution: if internalAccountId is already the active one, no need to load the conversationList another time. when there is only one account -> currentUser id and internalAccountId are the same so it would not enter the condition. Thus also allowing it when only one user exists. Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
e69a03a7ce
commit
ac5061d8a4
@ -450,6 +450,9 @@ class AccountVerificationController(args: Bundle? = null) : BaseController(
|
|||||||
Log.d(TAG, "proceedWithLogin...")
|
Log.d(TAG, "proceedWithLogin...")
|
||||||
cookieManager.cookieStore.removeAll()
|
cookieManager.cookieStore.removeAll()
|
||||||
|
|
||||||
|
if (userManager.users.blockingGet().size == 1 ||
|
||||||
|
userManager.currentUser.blockingGet().id != internalAccountId
|
||||||
|
) {
|
||||||
val userToSetAsActive = userManager.getUserWithId(internalAccountId).blockingGet()
|
val userToSetAsActive = userManager.getUserWithId(internalAccountId).blockingGet()
|
||||||
Log.d(TAG, "userToSetAsActive: " + userToSetAsActive.username)
|
Log.d(TAG, "userToSetAsActive: " + userToSetAsActive.username)
|
||||||
|
|
||||||
@ -474,6 +477,7 @@ class AccountVerificationController(args: Bundle? = null) : BaseController(
|
|||||||
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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun dispose() {
|
private fun dispose() {
|
||||||
for (i in disposables.indices) {
|
for (i in disposables.indices) {
|
||||||
|
Loading…
Reference in New Issue
Block a user