diff --git a/frontend/js/utils.js b/frontend/js/utils.js index ec522bb..ef8bfdd 100644 --- a/frontend/js/utils.js +++ b/frontend/js/utils.js @@ -1,5 +1,6 @@ import { state } from './state.js'; import { api } from './auth.js'; +import { openFile } from './viewer.js'; // --------------------------------------------------------------------------- // File extension → Lucide icon mapping @@ -424,7 +425,7 @@ async function saveFile() { setTimeout(() => { closeEditor(); - if (state.currentVault === editorVault && state.currentPath === state.editorPath) { + if (state.currentVault === state.editorVault && state.currentPath === state.editorPath) { openFile(state.currentVault, state.currentPath); } }, 800); @@ -438,7 +439,7 @@ async function saveFile() { } async function deleteFile() { - if (!editorVault || !state.editorPath) return; + if (!state.editorVault || !state.editorPath) return; const deleteBtn = document.getElementById("editor-delete"); const originalHTML = deleteBtn.innerHTML;