diff --git a/docs/base-account/reference/base-pay/getOrCreateSubscriptionOwnerWallet.mdx b/docs/base-account/reference/base-pay/getOrCreateSubscriptionOwnerWallet.mdx index 05291f756..6e54db14a 100644 --- a/docs/base-account/reference/base-pay/getOrCreateSubscriptionOwnerWallet.mdx +++ b/docs/base-account/reference/base-pay/getOrCreateSubscriptionOwnerWallet.mdx @@ -302,7 +302,10 @@ async function initialize() { } // Initialize once at startup -initialize().catch(console.error); +initialize().catch((error) => { + console.error(error); + process.exit(1); +}); ``` diff --git a/docs/iframe-theme.js b/docs/iframe-theme.js index 35287274c..72a57ff03 100644 --- a/docs/iframe-theme.js +++ b/docs/iframe-theme.js @@ -6,9 +6,10 @@ iframe.style.background = "transparent"; iframe.allowTransparency = true; - // Use postMessage to communicate with the iframe since we can't access contentDocument due to CORS + // Send message via a specific postMessage format that storybook-dark-mode addon expects const sendThemeMessage = () => { try { + // Standard custom theme message (from previous logic) const message = { type: 'THEME_CHANGE', isDark: isDark, @@ -17,6 +18,11 @@ } }; iframe.contentWindow.postMessage(message, '*'); + + // Send message to storybook-dark-mode channel to toggle its internal state + iframe.contentWindow.postMessage(JSON.stringify({ + event: { type: 'storybook-dark-mode', args: [isDark] } + }), '*'); } catch (e) { console.warn("Could not send message to iframe:", e); } @@ -53,7 +59,6 @@ document.addEventListener("DOMContentLoaded", updateIframesForDarkMode); } else { setTimeout(updateIframesForDarkMode, 100); - // TODO: add Storybook with Darkmode enabled let themeChangeCount = 0; const themeChangeInterval = setInterval(() => { if (themeChangeCount < 2) { diff --git a/storybook/stories/components/AppWithWalletModal.tsx b/storybook/stories/components/AppWithWalletModal.tsx index d8631e421..c931cb294 100644 --- a/storybook/stories/components/AppWithWalletModal.tsx +++ b/storybook/stories/components/AppWithWalletModal.tsx @@ -42,7 +42,6 @@ export default function AppWithWalletModal({