Skip to content

Commit 6c8193c

Browse files
author
Jon Tzeng
committed
Prevent double-tap on Next in gift card purchase scene
Add isCreatingOrder to the early-return guard in handleNextPress so a second tap during the brief window before React disables the button cannot trigger duplicate order creation.
1 parent 1602cac commit 6c8193c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/scenes/GiftCardPurchaseScene.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,12 @@ export const GiftCardPurchaseScene: React.FC<Props> = props => {
356356
})
357357

358358
const handleNextPress = useHandler(async () => {
359-
if (selectedAmount == null || provider == null || !isReady) {
359+
if (
360+
selectedAmount == null ||
361+
provider == null ||
362+
!isReady ||
363+
isCreatingOrder
364+
) {
360365
return
361366
}
362367

0 commit comments

Comments
 (0)