Fix account update on login/logout

This commit is contained in:
sim 2024-11-09 17:07:34 +00:00
parent 6140b2a422
commit 94cd3badba

View File

@ -16,13 +16,16 @@ object AccountFactory {
AccountType.SSO -> SSOAccount(context) AccountType.SSO -> SSOAccount(context)
AccountType.Direct -> DirectAccount(context) AccountType.Direct -> DirectAccount(context)
}.takeIf { !connected || it.connected }.also { }.takeIf { !connected || it.connected }.also {
if (connected) {
account = it account = it
} }
} }
} }
}
fun logout(context: Context) { fun logout(context: Context) {
getAccount(context)?.logout(context) getAccount(context)?.logout(context)
account = null
} }
fun Context.setTypeSSO() { fun Context.setTypeSSO() {