From: Damyan Ivanov Date: Sun, 22 Aug 2021 16:18:24 +0000 (+0300) Subject: do not reset the new transaction model in the constructor X-Git-Tag: v0.20.0~6 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=3775284655ecfc838ae81f722e123fee507d25f7;p=mobile-ledger.git do not reset the new transaction model in the constructor 1) reset() requires that there is a current profile in Data and that may not be true because the new transaction activity may be started by a shortcut referencing a profile that was removed and that may have been the last profile, i.e. there may be no profiles at that moment 2) reset is later called by the new transaction fragment anyway, when it has ensured that there is an active profile --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java index 35bb3c82..8b96f365 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java @@ -80,7 +80,6 @@ public class NewTransactionModel extends ViewModel { private final MutableLiveData focusInfo = new MutableLiveData<>(); private boolean observingDataProfile; public NewTransactionModel() { - reset(); } public LiveData getShowCurrency() { return showCurrency;