Merge remote-tracking branch 'origin' into feature/tracking

This commit is contained in:
Linus Flood
2024-12-16 09:11:28 +01:00
42 changed files with 630 additions and 325 deletions

View File

@@ -5,10 +5,14 @@ import { useCallback, useEffect } from "react"
import { useIntl } from "react-intl"
import { PaymentErrorCodeEnum } from "@/constants/booking"
import { useEnterDetailsStore } from "@/stores/enter-details"
import { toast } from "@/components/TempDesignSystem/Toasts"
export function usePaymentFailedToast() {
const updateSearchParams = useEnterDetailsStore(
(state) => state.actions.updateSeachParamString
)
const intl = useIntl()
const searchParams = useSearchParams()
const pathname = usePathname()
@@ -43,6 +47,15 @@ export function usePaymentFailedToast() {
const queryParams = new URLSearchParams(searchParams.toString())
queryParams.delete("errorCode")
updateSearchParams(queryParams.toString())
router.push(`${pathname}?${queryParams.toString()}`)
}, [searchParams, pathname, errorCode, errorMessage, router])
}, [
searchParams,
pathname,
errorCode,
errorMessage,
router,
updateSearchParams,
])
}