fix crash when logging out active account

This commit is contained in:
sk 2023-05-31 10:05:31 +02:00
parent 2858aeb55e
commit 5e7a00de3e
1 changed files with 9 additions and 1 deletions

View File

@ -194,7 +194,15 @@ public class AccountSwitcherSheet extends BottomSheet{
private void onLoggedOut(String accountID){ private void onLoggedOut(String accountID){
AccountSessionManager.getInstance().removeAccount(accountID); AccountSessionManager.getInstance().removeAccount(accountID);
dismiss(); String activeAccountID = fragment != null
? fragment.getAccountID()
: AccountSessionManager.getInstance().getLastActiveAccountID();
if (accountID.equals(activeAccountID)) {
activity.finish();
activity.startActivity(new Intent(activity, MainActivity.class));
} else {
dismiss();
}
} }
@Override @Override