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() {