diff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.js index 874bb5f824e36574fd1d70904e4ee42e5fb5ebb5..390fa77648c4a375bf08bbdffe05d01da7e5bd19 100644 --- a/packages/desktop-client/src/components/accounts/Account.js +++ b/packages/desktop-client/src/components/accounts/Account.js @@ -195,10 +195,15 @@ function ReconcileTooltip({ account, onReconcile, onClose }) { let balance = useSheetValue(queries.accountBalance(account)); function onSubmit(e) { + e.preventDefault(); let input = e.target.elements[0]; let amount = currencyToInteger(input.value); - onReconcile(amount == null ? balance : amount); - onClose(); + if (amount != null) { + onReconcile(amount == null ? balance : amount); + onClose(); + } else { + input.select(); + } } return ( diff --git a/packages/loot-core/src/shared/util.ts b/packages/loot-core/src/shared/util.ts index 9506ee207c85d50aa347f42bc6f20ca6a1fa937e..b62bf249d74ad0ccbe780e1e6ee610537ee50fee 100644 --- a/packages/loot-core/src/shared/util.ts +++ b/packages/loot-core/src/shared/util.ts @@ -354,7 +354,7 @@ export function currencyToAmount(str) { export function currencyToInteger(str) { let amount = currencyToAmount(str); - return amount ? amountToInteger(amount) : null; + return amount == null ? null : amountToInteger(amount); } export function stringToInteger(str) { diff --git a/upcoming-release-notes/915.md b/upcoming-release-notes/915.md new file mode 100644 index 0000000000000000000000000000000000000000..e8b2e2abc76a4437f2f7cba8534da26d1a5eb20a --- /dev/null +++ b/upcoming-release-notes/915.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [j-f1] +--- + +Fix reconciling a budget with a zero value