Update sonner

This commit is contained in:
Anton Gunnarsson
2025-05-07 09:57:54 +02:00
parent 11c1810249
commit 83646d4d02
4 changed files with 16 additions and 23 deletions

View File

@@ -38,15 +38,12 @@ export function useGuaranteePaymentFailedToast() {
if (!errorCode || errorCode === BookingErrorCodeEnum.TransactionCancelled)
return
// setTimeout is needed to show toasts on page load: https://sonner.emilkowal.ski/toast#render-toast-on-page-load
setTimeout(() => {
const toastType =
errorCode === BookingErrorCodeEnum.TransactionCancelled
? "warning"
: "error"
const toastType =
errorCode === BookingErrorCodeEnum.TransactionCancelled
? "warning"
: "error"
toast[toastType](errorMessage)
toast[toastType](errorMessage)
})
const ancillary = searchParams.get("ancillary")
if ((errorCode && ancillary) || errorCode === "AncillaryFailed") {
return

View File

@@ -41,15 +41,11 @@ export function usePaymentFailedToast() {
useEffect(() => {
if (!errorCode) return
// setTimeout is needed to show toasts on page load: https://sonner.emilkowal.ski/toast#render-toast-on-page-load
setTimeout(() => {
const toastType =
errorCode === BookingErrorCodeEnum.TransactionCancelled
? "warning"
: "error"
toast[toastType](errorMessage)
})
const toastType =
errorCode === BookingErrorCodeEnum.TransactionCancelled
? "warning"
: "error"
toast[toastType](errorMessage)
const queryParams = new URLSearchParams(searchParams.toString())
queryParams.delete("errorCode")

View File

@@ -104,7 +104,7 @@
"react-to-print": "^3.1.0",
"server-only": "^0.0.1",
"slugify": "^1.6.6",
"sonner": "^1.7.0",
"sonner": "^2.0.3",
"supercluster": "^8.0.1",
"superjson": "^2.2.2",
"usehooks-ts": "3.1.1",