fixes in event propagation

This commit is contained in:
zadam
2022-07-10 15:01:05 +02:00
parent 1ad406ced5
commit 89a4165c77
2 changed files with 15 additions and 15 deletions

View File

@@ -28,7 +28,7 @@ export default class NoteContextAwareWidget extends BasicWidget {
}
get notePath() {
return this.noteContext.notePath && this.noteContext;
return this.noteContext?.notePath;
}
get hoistedNoteId() {
@@ -64,7 +64,7 @@ export default class NoteContextAwareWidget extends BasicWidget {
async refreshWithNote(note) {}
async noteSwitchedEvent({noteContext, notePath}) {
// if notePath does not match then the noteContext has been switched to another note in the mean time
// if notePath does not match then the noteContext has been switched to another note in the meantime
if (noteContext.notePath === notePath) {
await this.noteSwitched();
}
@@ -88,7 +88,7 @@ export default class NoteContextAwareWidget extends BasicWidget {
async noteSwitchedAndActivatedEvent({noteContext, notePath}) {
this.noteContext = noteContext;
// if notePath does not match then the noteContext has been switched to another note in the mean time
// if notePath does not match then the noteContext has been switched to another note in the meantime
if (this.notePath === notePath) {
await this.refresh();
}