fix calendar widget when hoisted into hidden subtree

This commit is contained in:
zadam
2022-12-23 15:46:33 +01:00
parent c34bccf7e8
commit c6a05d8853
2 changed files with 6 additions and 4 deletions

View File

@@ -39,6 +39,8 @@ class NoteContext extends Component {
async setNote(inputNotePath, triggerSwitchEvent = true) {
const resolvedNotePath = await this.getResolvedNotePath(inputNotePath);
console.log("EEEEEE", inputNotePath, resolvedNotePath);
if (!resolvedNotePath) {
return;
}
@@ -67,14 +69,14 @@ class NoteContext extends Component {
&& this.notePath.startsWith("root/_hidden")
&& !this.note.hasLabel("keepCurrentHoisting")
) {
// hidden subtree displays only when hoisted so it doesn't make sense to keep root as hoisted note
// hidden subtree displays only when hoisted, so it doesn't make sense to keep root as hoisted note
let hoistedNoteId = '_hidden';
if (this.note.isLaunchBarConfig()) {
hoistedNoteId = '_lbRoot';
} else if (this.note.isOptions()) {
hoistedNoteId = 'options';
hoistedNoteId = '_options';
}
await this.setHoistedNoteId(hoistedNoteId);