From 8ca9621d424398fbedb2b1fe497243fcd360d871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Sat, 25 Mar 2023 12:21:16 +0900 Subject: [PATCH] build(#10336): show popups on Story --- packages/frontend/.storybook/preview.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/frontend/.storybook/preview.ts b/packages/frontend/.storybook/preview.ts index 291432db0f..752a86bd19 100644 --- a/packages/frontend/.storybook/preview.ts +++ b/packages/frontend/.storybook/preview.ts @@ -14,6 +14,7 @@ const appInitialized = Symbol(); let moduleInitialized = false; let unobserve = () => {}; +let misskeyOS = null; function loadTheme(applyTheme: typeof import('../src/scripts/theme')['applyTheme']) { unobserve(); @@ -51,7 +52,8 @@ queueMicrotask(() => { import('../src/directives'), import('../src/widgets'), import('../src/scripts/theme'), - ]).then(([{ default: components }, { default: directives }, { default: widgets }, { applyTheme }]) => { + import('../src/os'), + ]).then(([{ default: components }, { default: directives }, { default: widgets }, { applyTheme }, os]) => { setup((app) => { moduleInitialized = true; if (app[appInitialized]) { @@ -62,6 +64,7 @@ queueMicrotask(() => { components(app); directives(app); widgets(app); + misskeyOS = os; }); }); }); @@ -79,6 +82,17 @@ const preview = { return story; }, mswDecorator, + (Story, context) => { + return { + setup() { + return { + context, + popups: misskeyOS.popups, + }; + }, + template: '
', + }; + }, ], parameters: { msw: {