From f5875bffa7763fbfb1a4dfc3d0348492287c2056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Mon, 12 Jan 2026 10:14:07 +0000 Subject: [PATCH] Merged in fix/SA-1180-my-stay-crashing (pull request #3419) fix(SA-1180): update url for manage booking * fix(SA-1180): update url for manage booking Approved-by: Matilda Haneling Approved-by: Linus Flood --- .../Upcoming/ManageStay/Actions/AddToCalendar/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/AddToCalendar/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/AddToCalendar/index.tsx index 757d1f698..095d14c43 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/AddToCalendar/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/AddToCalendar/index.tsx @@ -24,13 +24,14 @@ export default function AddToCalendarAction() { hotel: state.hotel, hotelUrl: state.hotelUrl, })) - let baseUrl = typeof window !== "undefined" ? window.location.hostname : "" - if (baseUrl.includes("localhost") || !baseUrl) { + + let baseUrl = + typeof window !== "undefined" ? window.location.origin : undefined + if (!baseUrl || baseUrl.includes("localhost")) { // Localhost not valid for calendar URL baseUrl = "https://www.scandichotels.com" } - - const url = new URL(hotelUrl || "", baseUrl) + const url = new URL(hotelUrl || "/", baseUrl) const calendarEvent: EventAttributes = { busyStatus: "FREE",