mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 10:33:02 -05:00
Fix currencyToInteger returning null when amount is zero (#915)
Fixes #913. (And probably a few other similar bugs)
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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) {
|
||||
|
||||
6
upcoming-release-notes/915.md
Normal file
6
upcoming-release-notes/915.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [j-f1]
|
||||
---
|
||||
|
||||
Fix reconciling a budget with a zero value
|
||||
Reference in New Issue
Block a user