diff --git a/frontend/src/core/extensions/cookieConsentConfig.ts b/frontend/src/core/extensions/cookieConsentConfig.ts new file mode 100644 index 000000000..5d5b72773 --- /dev/null +++ b/frontend/src/core/extensions/cookieConsentConfig.ts @@ -0,0 +1,6 @@ +/** + * Optional overrides for cookie consent config. + */ +export function getCookieConsentOverrides(): Record { + return {}; +} diff --git a/frontend/src/core/hooks/useCookieConsent.ts b/frontend/src/core/hooks/useCookieConsent.ts index a3a7977c1..40c1a196d 100644 --- a/frontend/src/core/hooks/useCookieConsent.ts +++ b/frontend/src/core/hooks/useCookieConsent.ts @@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next'; import { BASE_PATH } from '@app/constants/app'; import { useAppConfig } from '@app/contexts/AppConfigContext'; import { TOUR_STATE_EVENT, type TourStatePayload } from '@app/constants/events'; +import { getCookieConsentOverrides } from '@app/extensions/cookieConsentConfig'; declare global { interface Window { @@ -112,9 +113,11 @@ export const useCookieConsent = ({ } try { + const overrides = getCookieConsentOverrides(); window.CookieConsent.run({ autoShow: true, hideFromBots: false, + ...overrides, guiOptions: { consentModal: { layout: "bar", diff --git a/frontend/src/desktop/extensions/cookieConsentConfig.ts b/frontend/src/desktop/extensions/cookieConsentConfig.ts new file mode 100644 index 000000000..8a40d7f66 --- /dev/null +++ b/frontend/src/desktop/extensions/cookieConsentConfig.ts @@ -0,0 +1,7 @@ +export function getCookieConsentOverrides(): Record { + return { + cookie: { + useLocalStorage: true, // Cookies don't reliably persist on desktop, but localStorage does + } + }; +}