small fixes

This commit is contained in:
zadam
2022-12-23 15:07:48 +01:00
parent 698eb53006
commit 0441e7396a
13 changed files with 58 additions and 38 deletions

View File

@@ -23,7 +23,23 @@ function isHoistedInHiddenSubtree() {
return hoistedNote.hasAncestor('_hidden');
}
function getHoistedNote() {
return becca.getNote(cls.getHoistedNoteId());
}
function getWorkspaceNote() {
const hoistedNote = getHoistedNote();
if (hoistedNote.isRoot() || hoistedNote.hasLabel('workspace')) {
return hoistedNote;
} else {
return becca.getRoot();
}
}
module.exports = {
getHoistedNoteId,
getHoistedNote,
getWorkspaceNote,
isHoistedInHiddenSubtree
};