This commit is contained in:
@@ -30,13 +30,14 @@ export function PaymentStatusBanner() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
if (params.has("paid")) {
|
||||
setState("paid");
|
||||
// Reload after 4s so the status badge picks up the webhook's
|
||||
// effect on the invoice row. By then most webhook deliveries
|
||||
// have landed; if not the user just sees "open" and can
|
||||
// manually refresh.
|
||||
// The webhook usually arrives before the browser redirect
|
||||
// completes, so the page often renders with status='paid'
|
||||
// on first load and this refresh is a no-op. In the rare
|
||||
// case where it arrives slightly after, a short refresh
|
||||
// picks up the status flip. 1.5s is comfortable for both.
|
||||
const timer = setTimeout(() => {
|
||||
router.refresh();
|
||||
}, 4000);
|
||||
}, 1500);
|
||||
// Strip the query string out of the URL.
|
||||
const cleanUrl = window.location.pathname;
|
||||
window.history.replaceState({}, "", cleanUrl);
|
||||
|
||||
Reference in New Issue
Block a user