]> git.ktnx.net Git - mobile-ledger.git/commitdiff
speculatively update last update date before the transactions are stored
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 23 Apr 2021 05:09:41 +0000 (05:09 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 23 Apr 2021 05:09:41 +0000 (05:09 +0000)
this a white lie, because the displayed list is the new one, retrieved
at the given time

app/src/main/java/net/ktnx/mobileledger/async/TransactionAccumulator.java

index 46b8426abbae7aaf1b16b91fd975ed87af52640b..62b962748b9bab4e3a0deda55e1fe77f2cc34bc9 100644 (file)
 
 package net.ktnx.mobileledger.async;
 
+import net.ktnx.mobileledger.model.Data;
 import net.ktnx.mobileledger.model.LedgerTransaction;
 import net.ktnx.mobileledger.model.TransactionListItem;
 import net.ktnx.mobileledger.ui.MainModel;
 import net.ktnx.mobileledger.utils.SimpleDate;
 
 import java.util.ArrayList;
+import java.util.Date;
 
 public class TransactionAccumulator {
     private final ArrayList<TransactionListItem> list = new ArrayList<>();
@@ -65,6 +67,7 @@ public class TransactionAccumulator {
     public void done() {
         done = true;
         model.setDisplayedTransactions(list);
+        Data.lastUpdateDate.postValue(new Date());
         model.setFirstTransactionDate(earliestDate);
         model.setLastTransactionDate(latestDate);
     }