From 95f74e99982edc8750858ff9400048c3d6f07e81 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 23 Apr 2021 00:10:46 +0300 Subject: [PATCH] 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 --- .../main/java/net/ktnx/mobileledger/dao/TransactionDAO.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)); -- 2.39.5