From: Damyan Ivanov Date: Tue, 26 Nov 2019 22:03:50 +0000 (+0200) Subject: NT fragment: copy the account objects when constructing the transaction to send X-Git-Tag: v0.11.0~11 X-Git-Url: https://git.ktnx.net/?p=mobile-ledger-staging.git;a=commitdiff_plain;h=bdb39816ef9d0581395547a2f6a7476d825938b3 NT fragment: copy the account objects when constructing the transaction to send the single account row without an amount has its amount set and this should not reflect the data in the model which may be re-displayed if when the save is unsuccessful --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java index e9d2e331..10f246d7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java @@ -205,7 +205,8 @@ public class NewTransactionFragment extends Fragment { LedgerTransactionAccount emptyAmountAccount = null; float emptyAmountAccountBalance = 0; for (int i = 0; i < viewModel.getAccountCount(); i++) { - LedgerTransactionAccount acc = viewModel.getAccount(i); + LedgerTransactionAccount acc = + new LedgerTransactionAccount(viewModel.getAccount(i)); if (acc.getAccountName() .trim() .isEmpty())