mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
web: clear editor on unlocking the note
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user