From 94cd3badbaeed6a170f450e6bf938974ce95cb90 Mon Sep 17 00:00:00 2001 From: sim Date: Sat, 9 Nov 2024 17:07:34 +0000 Subject: [PATCH] Fix account update on login/logout --- .../distributor/nextpush/account/AccountFactory.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/unifiedpush/distributor/nextpush/account/AccountFactory.kt b/app/src/main/java/org/unifiedpush/distributor/nextpush/account/AccountFactory.kt index 29a955f..9736807 100644 --- a/app/src/main/java/org/unifiedpush/distributor/nextpush/account/AccountFactory.kt +++ b/app/src/main/java/org/unifiedpush/distributor/nextpush/account/AccountFactory.kt @@ -16,13 +16,16 @@ object AccountFactory { AccountType.SSO -> SSOAccount(context) AccountType.Direct -> DirectAccount(context) }.takeIf { !connected || it.connected }.also { - account = it + if (connected) { + account = it + } } } } fun logout(context: Context) { getAccount(context)?.logout(context) + account = null } fun Context.setTypeSSO() {