Merged in fix/SW-3208-webviews-change-dates-on-my- (pull request #2638)
fix(SW-3208): Fixed webview for change date in MyStay * fix(SW-3208): Fixed webview for change date in MyStay Approved-by: Linus Flood
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
"use client"
|
||||
import { useSession } from "next-auth/react"
|
||||
import { useState } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
@@ -11,7 +10,6 @@ import { useMyStayStore } from "@/stores/my-stay"
|
||||
|
||||
import { sumPackages } from "@/components/HotelReservation/utils"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import { isValidClientSession } from "@/utils/clientSession"
|
||||
|
||||
import Confirmation from "./Confirmation"
|
||||
import Form from "./Form"
|
||||
@@ -24,8 +22,6 @@ interface Dates {
|
||||
}
|
||||
|
||||
export default function Steps({ closeModal }: ChangeDatesStepsProps) {
|
||||
const { data: session } = useSession()
|
||||
const isLoggedIn = isValidClientSession(session)
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
const utils = trpc.useUtils()
|
||||
@@ -33,8 +29,8 @@ export default function Steps({ closeModal }: ChangeDatesStepsProps) {
|
||||
const [newPrice, setNewPrice] = useState<string | null>(null)
|
||||
const [noAvailability, setNoAvailability] = useState(false)
|
||||
|
||||
const { breakfast, currencyCode, hotelId, packages, room } = useMyStayStore(
|
||||
(state) => ({
|
||||
const { breakfast, currencyCode, hotelId, packages, room, isLoggedIn } =
|
||||
useMyStayStore((state) => ({
|
||||
breakfast: state.bookedRoom.breakfast,
|
||||
currencyCode: state.bookedRoom.currencyCode,
|
||||
hotelId: state.bookedRoom.hotelId,
|
||||
@@ -46,8 +42,8 @@ export default function Steps({ closeModal }: ChangeDatesStepsProps) {
|
||||
rateCode: state.bookedRoom.rateDefinition.rateCode,
|
||||
roomTypeCode: state.bookedRoom.roomTypeCode,
|
||||
},
|
||||
})
|
||||
)
|
||||
isLoggedIn: state.isLoggedIn,
|
||||
}))
|
||||
|
||||
async function checkAvailability(fromDate: string, toDate: string) {
|
||||
setNoAvailability(false)
|
||||
|
||||
Reference in New Issue
Block a user