Skip to content
Snippets Groups Projects
Unverified Commit 131bb867 authored by Jed Fox's avatar Jed Fox Committed by GitHub
Browse files

Fix currencyToInteger returning null when amount is zero (#915)

Fixes #913. (And probably a few other similar bugs)
parent eed097d4
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
---
category: Bugfix
authors: [j-f1]
---
Fix reconciling a budget with a zero value
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment