From: Damyan Ivanov Date: Thu, 7 Mar 2019 04:14:16 +0000 (+0200) Subject: update the in-memory account list after parsing the JSON account list X-Git-Tag: v0.8~33 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=7b32fa0312e4b099b5d21f2764a91ac8435af02d;p=mobile-ledger.git update the in-memory account list after parsing the JSON account list similar to what the legacy code does already --- diff --git a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java index 965c1f98..dcc91b2f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -372,6 +372,7 @@ public class RetrieveTransactionsTask profile.markAccountsAsNotPresent(db); AccountListParser parser = new AccountListParser(resp); + ArrayList accountList = new ArrayList<>(); while (true) { throwIfCancelled(); @@ -384,12 +385,15 @@ public class RetrieveTransactionsTask profile.storeAccountValue(acc.getName(), b.getAcommodity(), b.getAquantity().asFloat()); } + + accountList.add(acc); } throwIfCancelled(); profile.deleteNotPresentAccounts(db); throwIfCancelled(); db.setTransactionSuccessful(); + Data.accounts.set(accountList); } finally { db.endTransaction();