fix: make sure all searchparams are used in redirect
This commit is contained in:
committed by
Simon.Emanuelsson
parent
1b3999a050
commit
744af22b08
@@ -1,4 +1,5 @@
|
||||
"use client"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { useRef } from "react"
|
||||
|
||||
import { useDetailsStore } from "@/stores/details"
|
||||
@@ -14,6 +15,7 @@ export default function StepsProvider({
|
||||
breakfastPackages,
|
||||
children,
|
||||
isMember,
|
||||
searchParams,
|
||||
step,
|
||||
}: StepsProviderProps) {
|
||||
const storeRef = useRef<StepsStore>()
|
||||
@@ -21,6 +23,7 @@ export default function StepsProvider({
|
||||
const updateBreakfast = useDetailsStore(
|
||||
(state) => state.actions.updateBreakfast
|
||||
)
|
||||
const router = useRouter()
|
||||
|
||||
if (!storeRef.current) {
|
||||
const noBedChoices = bedTypes.length === 1
|
||||
@@ -41,7 +44,9 @@ export default function StepsProvider({
|
||||
step,
|
||||
isMember,
|
||||
noBedChoices,
|
||||
noBreakfast
|
||||
noBreakfast,
|
||||
searchParams,
|
||||
router.push
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user