Merged in fix/add-breakfast-wrong-quantity (pull request #2086)
fix: check if breakfast and refill modal with correct confirmation if cancelled/error payment * fix: check if breakfast and refill modal with correct confirmation if cancelled/error payment * fix: only include packages with quantity Approved-by: Linus Flood Approved-by: Matilda Landström
This commit is contained in:
@@ -48,6 +48,7 @@ export const getAncillarySessionData = ():
|
||||
quantity: number
|
||||
comment: string | undefined
|
||||
}[]
|
||||
isBreakfast: boolean
|
||||
}
|
||||
| undefined => {
|
||||
if (typeof window === "undefined") return undefined
|
||||
@@ -65,6 +66,7 @@ export function setAncillarySessionData({
|
||||
formData,
|
||||
selectedAncillary,
|
||||
packages,
|
||||
isBreakfast,
|
||||
}: {
|
||||
formData?: AncillaryFormData
|
||||
selectedAncillary?: Ancillary["ancillaryContent"][number] | null
|
||||
@@ -73,14 +75,20 @@ export function setAncillarySessionData({
|
||||
quantity: number
|
||||
comment: string | undefined
|
||||
}[]
|
||||
isBreakfast: boolean
|
||||
}) {
|
||||
if (typeof window === "undefined") return
|
||||
|
||||
try {
|
||||
const currentData = getAncillarySessionData() || {}
|
||||
sessionStorage.setItem(
|
||||
ancillarySessionKey,
|
||||
JSON.stringify({ ...currentData, formData, selectedAncillary, packages })
|
||||
JSON.stringify({
|
||||
...currentData,
|
||||
formData,
|
||||
selectedAncillary,
|
||||
packages,
|
||||
isBreakfast,
|
||||
})
|
||||
)
|
||||
} catch (error) {
|
||||
console.error("Error writing to session storage:", error)
|
||||
|
||||
Reference in New Issue
Block a user