mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
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:
1 parent
d88200f398
commit
7ef448987f
1 file changed
+2
-2
@@ -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,
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user