diff --git a/frontend/js/utils.js b/frontend/js/utils.js index 0493ad2..ec522bb 100644 --- a/frontend/js/utils.js +++ b/frontend/js/utils.js @@ -397,9 +397,9 @@ function closeEditor() { } async function saveFile() { - if ((!editorView && !state.fallbackEditorEl) || !editorVault || !state.editorPath) return; + if ((!state.editorView && !state.fallbackEditorEl) || !state.editorVault || !state.editorPath) return; - const content = editorView ? state.editorView.state.doc.toString() : state.fallbackEditorEl.value; + const content = state.editorView ? state.editorView.state.doc.toString() : state.fallbackEditorEl.value; const saveBtn = document.getElementById("editor-save"); const originalHTML = saveBtn.innerHTML;