fix(folio): parse raw amount input as cents in submit predicate

txnAmountField holds raw user keystrokes, not formatted balance text.
Route it through parseTypedAmount so "50" reads as $50, matching how
the app commits the transaction.
This commit is contained in:
pj committed 2026-05-31 18:56:46 +05:30
1 parent d88200f398
commit 7ef448987f
1 file changed
+2 -2
+2 -2
View File
@@ -10,7 +10,7 @@ import {
whenRoute,
} from "@sanderling/spec";
import { defaultActions } from "@sanderling/spec/defaults";
import { submitChangesBalanceByTypedAmount } from "./predicates";
import { parseTypedAmount, submitChangesBalanceByTypedAmount } from "./predicates";
interface Account {
name: string;
@@ -99,7 +99,7 @@ const submitMovesBalanceByTypedAmount = always(
next(() =>
submitChangesBalanceByTypedAmount({
lastAction: lastAction.current,
typedAmount: parseDollarCents(txnAmountField.previous?.text),
typedAmount: parseTypedAmount(txnAmountField.previous?.text),
prevTotalBalance: totalBalance.previous ?? 0,
currTotalBalance: totalBalance.current,
}),