hoisting bugfixes

This commit is contained in:
zadam
2020-10-19 22:10:25 +02:00
parent 991b335c3e
commit c2b64bad80
3 changed files with 16 additions and 3 deletions

View File

@@ -47,6 +47,9 @@ class TabContext extends Component {
if (await hoistedNoteService.checkNoteAccess(resolvedNotePath) === false) {
return; // note is outside of hoisted subtree and user chose not to unhoist
}
// if user choise to unhoist, cache was reloaded, but might not contain this note (since it's on unexpanded path)
await treeCache.getNote(noteId);
}
await this.triggerEvent('beforeNoteSwitch', {tabContext: this});
@@ -78,10 +81,17 @@ class TabContext extends Component {
notePath: this.notePath
});
}
// close dangling autocompletes after closing the tab
$(".aa-input").autocomplete("close");
}
/** @property {NoteShort} */
get note() {
if (this.noteId && !(this.noteId in treeCache.notes)) {
logError(`Cannot find tabContext's note id='${this.noteId}'`);
}
return treeCache.notes[this.noteId];
}