From: Damyan Ivanov Date: Thu, 22 Apr 2021 21:10:46 +0000 (+0300) Subject: fix storing transaction accounts (bad typo) X-Git-Tag: v0.18.0~46 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=95f74e99982edc8750858ff9400048c3d6f07e81;p=mobile-ledger.git fix storing transaction accounts (bad typo) this is the fastest storage approach, next thing to try -- compare existing records with the new-to-be and avoid the db update alltogether if they are the same --- diff --git a/app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java b/app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java index 9c3f21f2..9012d489 100644 --- a/app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java +++ b/app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java @@ -170,8 +170,7 @@ public abstract class TransactionDAO extends BaseDAO { trAccDao.getByOrderNoSync(trAcc.getTransactionId(), trAcc.getOrderNo()); if (existingAcc != null) { existingAcc.copyDataFrom(trAcc); - trAccDao.updateSync(trAcc); - trAcc = existingAcc; + trAccDao.updateSync(existingAcc); } else trAcc.setId(trAccDao.insertSync(trAcc));