mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21b5199db6 |
@@ -179,14 +179,17 @@ export function PreviewPane({ projectId, activeTab, onToggleView, isPreviewable
|
|||||||
// Legacy refresh function for build completion events
|
// Legacy refresh function for build completion events
|
||||||
const refreshIframeLegacy = useCallback(() => {
|
const refreshIframeLegacy = useCallback(() => {
|
||||||
if (iframeRef.current) {
|
if (iframeRef.current) {
|
||||||
// Force reload the iframe by updating its src
|
// Force reload the iframe by updating its src with a timestamp to bust cache
|
||||||
iframeRef.current.src = '/';
|
const currentSrc = `https://${projectId}.${previewDomain}/`;
|
||||||
// Use a small timeout to ensure the src is cleared before setting it back
|
const newSrc = `${currentSrc}?_refresh=${Date.now()}`;
|
||||||
|
iframeRef.current.src = newSrc;
|
||||||
|
|
||||||
|
// After a brief moment, remove the query param to clean up the URL
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (iframeRef.current) {
|
if (iframeRef.current) {
|
||||||
iframeRef.current.src = `https://${projectId}.${previewDomain}/`;
|
iframeRef.current.src = currentSrc;
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 100);
|
||||||
}
|
}
|
||||||
}, [projectId, previewDomain]);
|
}, [projectId, previewDomain]);
|
||||||
|
|
||||||
@@ -904,4 +907,4 @@ export function PreviewPane({ projectId, activeTab, onToggleView, isPreviewable
|
|||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user