Prevent auth dialog when failed to login in assistant and then successfully login another account

This commit is contained in:
Sylvain Berfini 2025-07-04 10:15:50 +02:00
parent 1a54746a80
commit 461537aa9c
2 changed files with 5 additions and 2 deletions

View file

@ -499,12 +499,13 @@ class CoreContext
if (account.findAuthInfo() == digestAuthInfoPendingPasswordUpdate) {
Log.i("$TAG Removed account matches auth info pending password update, removing dialog")
clearAuthenticationRequestDialogEvent.postValue(Event(true))
digestAuthInfoPendingPasswordUpdate = null
}
if (core.defaultAccount == null || core.defaultAccount == account) {
Log.w("$TAG Removed account was the default one, choosing another as default if possible")
val newDefaultAccount = core.accountList.find {
it.params.isRegisterEnabled == true
it.params.isRegisterEnabled
} ?: core.accountList.firstOrNull()
if (newDefaultAccount == null) {
Log.e("$TAG Failed to find a new default account!")

View file

@ -310,7 +310,9 @@ class MainActivity : GenericActivity() {
coreContext.digestAuthenticationRequestedEvent.observe(this) {
it.consume { identity ->
try {
if (coreContext.digestAuthInfoPendingPasswordUpdate != null) {
showAuthenticationRequestedDialog(identity)
}
} catch (e: WindowManager.BadTokenException) {
Log.e("$TAG Failed to show authentication dialog: $e")
}