removed dependency on note tree widget from app context

This commit is contained in:
zadam
2020-02-07 20:56:49 +01:00
parent 62e1284790
commit 6d912c4897
9 changed files with 32 additions and 54 deletions

View File

@@ -78,17 +78,17 @@ export default class Entrypoints extends Component {
}
toggleNoteHoistingListener() {
const node = appContext.getMainNoteTree().getActiveNode();
const note = appContext.getActiveTabNote();
hoistedNoteService.getHoistedNoteId().then(async hoistedNoteId => {
if (node.data.noteId === hoistedNoteId) {
if (note.noteId === hoistedNoteId) {
hoistedNoteService.unhoist();
}
else {
const note = await treeCache.getNote(node.data.noteId);
const note = await treeCache.getNote(note.noteId);
if (note.type !== 'search') {
hoistedNoteService.setHoistedNoteId(node.data.noteId);
hoistedNoteService.setHoistedNoteId(note.noteId);
}
}
});