From 2227732581fae8756db1dbbc0887b0709006aff1 Mon Sep 17 00:00:00 2001 From: Max Albrecht Date: Thu, 4 Jul 2024 20:44:01 +0200 Subject: [PATCH] PATCH: manager: force reloading of iframe when the story changes --- .../src/components/preview/FramesRenderer.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/ui/manager/src/components/preview/FramesRenderer.tsx b/code/ui/manager/src/components/preview/FramesRenderer.tsx index a1a89a9e5041..7511fd00be4f 100644 --- a/code/ui/manager/src/components/preview/FramesRenderer.tsx +++ b/code/ui/manager/src/components/preview/FramesRenderer.tsx @@ -70,13 +70,14 @@ export const FramesRenderer: FC = ({ return ref.type === 'auto-inject' || ref.id === refId; }, {}); - if (!frames['storybook-preview-iframe']) { - frames['storybook-preview-iframe'] = getStoryHref(baseUrl, storyId, { - ...queryParams, - ...(version && { version }), - viewMode, - }); - } + // PATCH: removing the if condition forces reloading the iframe when the story changes + // if (!frames['storybook-preview-iframe']) { + frames['storybook-preview-iframe'] = getStoryHref(baseUrl, storyId, { + ...queryParams, + ...(version && { version }), + viewMode, + }); + // } refsToLoad.forEach((ref) => { const id = `storybook-ref-${ref.id}`;