Skip to content

Commit 7c99f96

Browse files
authored
fix(checkout): Ensure transfer amount is positive (#2598)
1 parent 1bef4af commit 7c99f96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/checkout/widgets-lib/src/widgets/transfer/TransferWidget.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ function TransferWidgetInner(props: TransferWidgetInputs) {
127127
return;
128128
}
129129

130+
if (Number(viewState.amount) <= 0) {
131+
setViewState((s) => ({ ...s, amountError: 'Amount must be positive' }));
132+
return;
133+
}
134+
130135
setViewState({
131136
type: 'AWAITING_APPROVAL',
132137
checkout: viewState.checkout,

0 commit comments

Comments
 (0)