in the account switcher, do nothing if switching no new account was selected

prevent switching accounts if the currently selected account was tapped,
just close the dialog in this case.
(ux wise, it is better to show the current account - to get some overview
and also to easily see what the current account is)
This commit is contained in:
B. Petersen
2020-04-23 13:38:18 +02:00
parent 316eb47399
commit b2ed3d1775
@@ -239,9 +239,14 @@ public class AccountManager {
activity.finishAffinity();
activity.startActivity(new Intent(activity, WelcomeActivity.class));
} else { // switch account
switchAccount(activity, accounts.get(which));
activity.finishAffinity();
activity.startActivity(new Intent(activity.getApplicationContext(), ConversationListActivity.class));
Account account = accounts.get(which);
if (account.isCurrent()) {
dialog.dismiss();
} else {
switchAccount(activity, account);
activity.finishAffinity();
activity.startActivity(new Intent(activity.getApplicationContext(), ConversationListActivity.class));
}
}
});
if (accounts.size() > 1) {