fix crash when logging out active account
This commit is contained in:
parent
2858aeb55e
commit
5e7a00de3e
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue