auto set destination amount by source amount when destination amount is zero

This commit is contained in:
MaysWind
2024-03-10 19:55:29 +08:00
parent 6b4292596a
commit 2916106f27
+1 -1
View File
@@ -352,7 +352,7 @@ export const useTransactionsStore = defineStore('transactions', {
}
}
if ((!sourceAccount || !destinationAccount || transaction.destinationAmount === oldValue) &&
if ((!sourceAccount || !destinationAccount || transaction.destinationAmount === oldValue || transaction.destinationAmount === 0) &&
(stringCurrencyToNumeric(transactionConstants.minAmount) <= newValue &&
newValue <= stringCurrencyToNumeric(transactionConstants.maxAmount))) {
transaction.destinationAmount = newValue;