]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java
Data: migrate profile to a private variable, provide methods for accessing it
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / account_summary / AccountSummaryFragment.java
index dbc200eb8f6e8ff592ae02048c9682efd8326877..eb61dcc6b0bbee9f37a4ff0188687971afe5e113 100644 (file)
@@ -96,12 +96,10 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
             Data.scheduleTransactionListRetrieval(mainActivity);
         });
 
-        MobileLedgerProfile profile = Data.profile.getValue();
-        if (profile != null) {
-            profile.getDisplayedAccounts()
-                   .observe(getViewLifecycleOwner(),
-                           (accounts) -> onAccountsChanged(profile, accounts));
-        }
+        MobileLedgerProfile profile = Data.getProfile();
+        profile.getDisplayedAccounts()
+               .observe(getViewLifecycleOwner(),
+                       (accounts) -> onAccountsChanged(profile, accounts));
     }
     private void onAccountsChanged(MobileLedgerProfile profile, List<LedgerAccount> accounts) {
         Logger.debug("async-acc",