Prevent reload loop in storybook
This commit is contained in:
parent
2871f63f25
commit
5221fb3479
@ -22,7 +22,15 @@ export function useInsertLinkTags(params: {
|
|||||||
alreadyMountedComponentOrHookNames.has(componentOrHookName);
|
alreadyMountedComponentOrHookNames.has(componentOrHookName);
|
||||||
|
|
||||||
if (isAlreadyMounted) {
|
if (isAlreadyMounted) {
|
||||||
window.location.reload();
|
reload: {
|
||||||
|
if (
|
||||||
|
new URL(window.location.href).searchParams.get("viewMode") === "docs"
|
||||||
|
) {
|
||||||
|
// NOTE: Special case for Storybook, we want to avoid infinite reload loop.
|
||||||
|
break reload;
|
||||||
|
}
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,15 @@ export function useInsertScriptTags(params: {
|
|||||||
alreadyMountedComponentOrHookNames.has(componentOrHookName);
|
alreadyMountedComponentOrHookNames.has(componentOrHookName);
|
||||||
|
|
||||||
if (isAlreadyMounted) {
|
if (isAlreadyMounted) {
|
||||||
window.location.reload();
|
reload: {
|
||||||
|
if (
|
||||||
|
new URL(window.location.href).searchParams.get("viewMode") === "docs"
|
||||||
|
) {
|
||||||
|
// NOTE: Special case for Storybook, we want to avoid infinite reload loop.
|
||||||
|
break reload;
|
||||||
|
}
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user