Update sonner
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user