From b2ed3d1775886461b191ca3e96ef5192f84ac185 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Thu, 23 Apr 2020 13:38:18 +0200 Subject: [PATCH] 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) --- .../securesms/connect/AccountManager.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/org/thoughtcrime/securesms/connect/AccountManager.java b/src/org/thoughtcrime/securesms/connect/AccountManager.java index 660bb7d92..32aa176ee 100644 --- a/src/org/thoughtcrime/securesms/connect/AccountManager.java +++ b/src/org/thoughtcrime/securesms/connect/AccountManager.java @@ -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) {