NT fragment: copy the account objects when constructing the transaction to send
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 26 Nov 2019 22:03:50 +0000 (00:03 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 26 Nov 2019 22:03:50 +0000 (00:03 +0200)
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

app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java

index e9d2e33..10f246d 100644 (file)
@@ -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())