web: clear editor on unlocking the note

This commit is contained in:
Abdullah Atta
2024-03-05 15:37:45 +05:00
parent ca9a8d14fa
commit f35a3d8fa3
2 changed files with 9 additions and 7 deletions

View File

@@ -290,12 +290,14 @@ class EditorStore extends BaseStore {
state: SESSION_STATES.new
};
});
noteStore.setSelectedNote(0);
this.toggleProperties(false);
if (shouldNavigate)
hashNavigate(`/notes/create`, { replace: true, addNonce: true });
setTimeout(() => appStore.setIsEditorOpen(false), 100);
setDocumentTitle();
setTimeout(() => {
noteStore.setSelectedNote(0);
this.toggleProperties(false);
if (shouldNavigate)
hashNavigate(`/notes/create`, { replace: true, addNonce: true });
appStore.setIsEditorOpen(false);
setDocumentTitle();
}, 100);
};
setTitle = (noteId, title) => {

View File

@@ -116,7 +116,7 @@ class NoteStore extends BaseStore {
unlock = async (id) => {
return await Vault.unlockNote(id).then(async (res) => {
if (editorStore.get().session.id === id)
await editorStore.openSession(id);
await editorStore.clearSession(true);
this.refreshItem(id);
return res;
});