chore: do not generate history entries on snapshot switch (#21283)
This commit is contained in:
parent
2cbafd7adf
commit
c42a1205b1
|
|
@ -91,7 +91,12 @@ export const SnapshotTab: React.FunctionComponent<{
|
||||||
if (!iframeRef.current)
|
if (!iframeRef.current)
|
||||||
return;
|
return;
|
||||||
try {
|
try {
|
||||||
iframeRef.current.src = snapshotUrl + (pointX === undefined ? '' : `&pointX=${pointX}&pointY=${pointY}`);
|
const newUrl = snapshotUrl + (pointX === undefined ? '' : `&pointX=${pointX}&pointY=${pointY}`);
|
||||||
|
// Try preventing history entry from being created.
|
||||||
|
if (iframeRef.current.contentWindow)
|
||||||
|
iframeRef.current.contentWindow.location.replace(newUrl);
|
||||||
|
else
|
||||||
|
iframeRef.current.src = newUrl;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue