Revert "fix: prevent iframe from overriding file selection after file creation"

This reverts commit 6864e1c0cf.
This commit is contained in:
Ruben Fiszel
2026-02-23 23:07:51 +00:00
parent 6864e1c0cf
commit cded16fabf

View File

@@ -164,13 +164,10 @@
setFilesInIframe(files)
}
}
let ignoreSetActiveDocument = false
function setFilesInIframe(newFiles: Record<string, string>) {
const files = Object.fromEntries(
Object.entries(newFiles).filter(([path, _]) => !path.endsWith('/'))
)
ignoreSetActiveDocument = true
setTimeout(() => (ignoreSetActiveDocument = false), 500)
iframe?.contentWindow?.postMessage(
{
type: 'setFiles',
@@ -615,7 +612,6 @@
} else if (e.data.type === 'updateModules') {
modules = e.data.modules
} else if (e.data.type === 'setActiveDocument') {
if (ignoreSetActiveDocument) return
// Normalize Windows-style path separators to Linux-style
selectedDocument = e.data.path?.replace(/\\/g, '/')
} else if (e.data.type === 'inspectorSelect') {