From 7b32fa0312e4b099b5d21f2764a91ac8435af02d Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 7 Mar 2019 06:14:16 +0200 Subject: [PATCH] update the in-memory account list after parsing the JSON account list similar to what the legacy code does already --- .../net/ktnx/mobileledger/async/RetrieveTransactionsTask.java | 4 ++++ 1 file changed, 4 insertions(+) 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(); -- 2.39.5