diff --git a/frontend/js/utils.js b/frontend/js/utils.js index 616a35d..8426ae1 100644 --- a/frontend/js/utils.js +++ b/frontend/js/utils.js @@ -424,10 +424,12 @@ async function saveFile() { saveBtn.innerHTML = ''; safeCreateIcons(); + const _savedVault = state.editorVault; + const _savedPath = state.editorPath; setTimeout(() => { closeEditor(); - if (state.currentVault === state.editorVault && state.currentPath === state.editorPath) { - openFile(state.currentVault, state.currentPath); + if (state.currentVault === _savedVault && state.currentPath === _savedPath) { + openFile(_savedVault, _savedPath); } }, 800); } catch (err) {