mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Reset iframe browser history on project change.
This commit is contained in:
1 parent
f5c5684ac8
commit
e5ca49962e
1 file changed
+6
-1
@@ -453,11 +453,16 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
|
||||
}
|
||||
}, [selectedFile, loadFileContent]);
|
||||
|
||||
// Reset selected file when projectId changes
|
||||
// Reset selected file and navigation history when projectId changes
|
||||
useEffect(() => {
|
||||
setSelectedFile(null);
|
||||
setFileContent('');
|
||||
setMobileCodeView('explorer');
|
||||
|
||||
// Reset navigation history and state
|
||||
setCurrentPath('/');
|
||||
setNavigationHistory(['/']);
|
||||
setHistoryIndex(0);
|
||||
}, [projectId]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user