Merged in fix/hide-bookingwidget-flag (pull request #1764)
fix: bookingwidget - hide BW if either pageSettings or siteConfig wants to hide it * fix: bookingwidget - hide BW if either pageSettings or siteConfig wants to hide it * Refactor Approved-by: Michael Zetterberg
This commit is contained in:
@@ -243,15 +243,11 @@ export const isBookingWidgetHidden = cache(
|
||||
const siteConfig =
|
||||
siteConfigResults.status === "fulfilled" ? siteConfigResults.value : null
|
||||
|
||||
if (pageSettings) {
|
||||
return pageSettings.page.settings.hide_booking_widget
|
||||
}
|
||||
const hideFromPageSettings =
|
||||
pageSettings?.page?.settings?.hide_booking_widget ?? false
|
||||
const hideFromSiteConfig = siteConfig?.bookingWidgetDisabled ?? false
|
||||
|
||||
if (siteConfig) {
|
||||
return siteConfig.bookingWidgetDisabled
|
||||
}
|
||||
|
||||
return false
|
||||
return hideFromPageSettings || hideFromSiteConfig
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user