Skip to content

Commit

Permalink
PATCH: manager: force reloading of iframe when the story changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eins78 committed Jul 4, 2024
1 parent 5b1e26c commit 2227732
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions code/ui/manager/src/components/preview/FramesRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ export const FramesRenderer: FC<FramesRendererProps> = ({
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}`;
Expand Down

0 comments on commit 2227732

Please sign in to comment.