mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
web: clear editor if opened note is unlocked
This commit is contained in:
@@ -320,9 +320,9 @@ class EditorStore extends BaseStore<EditorStore> {
|
||||
state: SESSION_STATES.new
|
||||
};
|
||||
});
|
||||
noteStore.setSelectedNote();
|
||||
this.toggleProperties(false);
|
||||
setTimeout(() => {
|
||||
noteStore.setSelectedNote();
|
||||
this.toggleProperties(false);
|
||||
if (shouldNavigate)
|
||||
hashNavigate(`/notes/create`, { replace: true, addNonce: true });
|
||||
appStore.setIsEditorOpen(false);
|
||||
|
||||
@@ -98,7 +98,7 @@ class NoteStore extends BaseStore<NoteStore> {
|
||||
unlock = async (id: string) => {
|
||||
return await Vault.unlockNote(id).then(async (res) => {
|
||||
if (editorStore.get().session.id === id)
|
||||
await editorStore.openSession(id);
|
||||
await editorStore.clearSession(true);
|
||||
await this.refresh();
|
||||
return res;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user