]> git.ktnx.net Git - mobile-ledger.git/commitdiff
when switching profiles, clear account list too
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 20 Sep 2020 12:31:39 +0000 (15:31 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 20 Sep 2020 12:31:39 +0000 (15:31 +0300)
app/src/main/java/net/ktnx/mobileledger/ui/MainModel.java
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index 5ca0e0be00c4cc5e05c73751a16be9eaba6e5ebc..44a6f303be75fac7d193b16cee33400af49d5e9b 100644 (file)
@@ -271,6 +271,7 @@ public class MainModel extends ViewModel {
     public void clearUpdateError() {
         updateError.postValue(null);
     }
+    public void clearAccounts() { displayedAccounts.postValue(new ArrayList<>()); }
     public void clearTransactions() {
         displayedTransactions.setValue(new ArrayList<>());
     }
index 3b44095117ee5ad105bfb45f056cbe1d406049b6..dc4645bcafbeadb4d0f4c4695156e983ba931dbb 100644 (file)
@@ -439,6 +439,7 @@ public class MainActivity extends ProfileThemedActivity {
 
         mProfileListAdapter.notifyDataSetChanged();
 
+        mainModel.clearAccounts();
         mainModel.clearTransactions();
 
         if (haveProfile) {