fix collapsing/expanding the book note

This commit is contained in:
zadam
2021-09-29 13:19:21 +02:00
parent c2d35dac4d
commit d975acc99a
4 changed files with 14 additions and 6 deletions

View File

@@ -66,12 +66,17 @@ export default class NoteListWidget extends NoteContextAwareWidget {
}
async refresh() {
this.$content.empty();
this.shownNoteId = null;
await super.refresh();
}
async refreshNoteListEvent({noteId}) {
if (this.isNote(noteId)) {
await this.renderNoteList(this.note);
}
}
/**
* We have this event so that we evaluate intersection only after note detail is loaded.
* If it's evaluated before note detail then it's clearly intersected (visible) although after note detail load
@@ -94,7 +99,7 @@ export default class NoteListWidget extends NoteContextAwareWidget {
}
entitiesReloadedEvent({loadResults}) {
if (loadResults.getAttributes().find(attr => attr.noteId === this.noteId && attr.name === 'viewType')) {
if (loadResults.getAttributes().find(attr => attr.noteId === this.noteId && ['viewType', 'expanded'].includes(attr.name))) {
this.shownNoteId = null; // force render
this.checkRenderStatus();