fix(files): look up tab from reactive array before setting content

This commit is contained in:
Hibryda 2026-03-10 02:55:38 +01:00
parent ea44719685
commit cfe3abcf00

View file

@ -111,12 +111,15 @@
} }
activeTabPath = node.path; activeTabPath = node.path;
// Load content // Load content — must look up from reactive array, not local reference
fileLoading = true; fileLoading = true;
try { try {
tab.content = await readFileContent(node.path); const content = await readFileContent(node.path);
const target = fileTabs.find(t => t.path === node.path);
if (target) target.content = content;
} catch (e) { } catch (e) {
tab.content = { type: 'Binary', message: `Error: ${e}` }; const target = fileTabs.find(t => t.path === node.path);
if (target) target.content = { type: 'Binary', message: `Error: ${e}` };
} finally { } finally {
fileLoading = false; fileLoading = false;
} }