mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +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,
|
whenRoute,
|
||||||
} from "@sanderling/spec";
|
} from "@sanderling/spec";
|
||||||
import { defaultActions } from "@sanderling/spec/defaults";
|
import { defaultActions } from "@sanderling/spec/defaults";
|
||||||
import { submitChangesBalanceByTypedAmount } from "./predicates";
|
import { parseTypedAmount, submitChangesBalanceByTypedAmount } from "./predicates";
|
||||||
|
|
||||||
interface Account {
|
interface Account {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -99,7 +99,7 @@ const submitMovesBalanceByTypedAmount = always(
|
|||||||
next(() =>
|
next(() =>
|
||||||
submitChangesBalanceByTypedAmount({
|
submitChangesBalanceByTypedAmount({
|
||||||
lastAction: lastAction.current,
|
lastAction: lastAction.current,
|
||||||
typedAmount: parseDollarCents(txnAmountField.previous?.text),
|
typedAmount: parseTypedAmount(txnAmountField.previous?.text),
|
||||||
prevTotalBalance: totalBalance.previous ?? 0,
|
prevTotalBalance: totalBalance.previous ?? 0,
|
||||||
currTotalBalance: totalBalance.current,
|
currTotalBalance: totalBalance.current,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in new issue
Block a user