From 000097b35364a1384baa083982785ca6e97cd312 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 23 Apr 2021 20:42:05 +0200 Subject: [PATCH] Require save to configure linked identity --- app/src/main/java/eu/faircode/email/FragmentAccount.java | 5 ++++- app/src/main/java/eu/faircode/email/FragmentPop.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 059d1319d5..93d87f0d09 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -1250,6 +1250,8 @@ public class FragmentAccount extends FragmentBase { nm.cancel("alert:" + account.id, 1); } + args.putBoolean("saved", true); + return false; } @@ -1271,7 +1273,8 @@ public class FragmentAccount extends FragmentBase { if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) { getParentFragmentManager().popBackStack(); - if (cbIdentity.isChecked()) { + boolean saved = args.getBoolean("saved"); + if (saved && cbIdentity.isChecked()) { Bundle aargs = new Bundle(); aargs.putLong("account", args.getLong("account")); diff --git a/app/src/main/java/eu/faircode/email/FragmentPop.java b/app/src/main/java/eu/faircode/email/FragmentPop.java index 9bae082d13..e376ba6a03 100644 --- a/app/src/main/java/eu/faircode/email/FragmentPop.java +++ b/app/src/main/java/eu/faircode/email/FragmentPop.java @@ -619,6 +619,8 @@ public class FragmentPop extends FragmentBase { nm.cancel("alert:" + account.id, 1); } + args.putBoolean("saved", true); + return false; } @@ -640,7 +642,8 @@ public class FragmentPop extends FragmentBase { if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) { getParentFragmentManager().popBackStack(); - if (cbIdentity.isChecked()) { + boolean saved = args.getBoolean("saved"); + if (saved && cbIdentity.isChecked()) { Bundle aargs = new Bundle(); aargs.putLong("account", args.getLong("account"));