Skip to content

Commit

Permalink
fix(web): dont adjust error toast timing
Browse files Browse the repository at this point in the history
  • Loading branch information
rin-yato committed Oct 11, 2024
1 parent f309b15 commit e3547c2
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions apps/web/src/route/portal/$checkoutId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,27 @@ function CheckoutPage() {
data.hasSuccessfulTransaction &&
!toastIdRef.current
) {
toastIdRef.current = toast.loading("Hold on tight! We're processing your payment.");
toastIdRef.current = toast.loading("Hold on tight! We're processing your payment.", {
duration: 35_000, // 35s
onAutoClose: (t) => {
toast.info("Unable to process your payment.", {
id: t.id,
richColors: true,
duration: 10_000, // 10s
});
},
});

setTimeout(() => {
if (data.hasSuccessfulWebhook && data.hasSuccessfulTransaction) return;

toast.info("Unable to process your payment.", {
id: toastIdRef.current,
richColors: true,
duration: 34_000, // 34s
duration: 10_000, // 10s
});
setIsProcessing(true);
}, 5000);
}, 35_000); // 35s
}

if (
Expand Down

0 comments on commit e3547c2

Please sign in to comment.