diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 28b8a59..71dcc63 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -69,6 +69,20 @@ const fullCanonicalUrl = canonicalUrl || `${siteUrl}${Astro.url.pathname}`; showTitle: false, textColor: "#000000", }, + // Let the dark mode toast wait until the cookie banner is gone + callback: { + onBannerShown: function () { + window.__iubBannerOpen = true; + }, + onPreferenceExpressed: function () { + window.__iubBannerOpen = false; + window.dispatchEvent(new Event("iub-consent")); + }, + onReady: function () { + window.__iubReady = true; + window.dispatchEvent(new Event("iub-ready")); + }, + }, };