From a7f4bf8289c33cbb5ad6f9f22e4240817c2020c8 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 6 Nov 2022 14:19:40 +0100 Subject: [PATCH] fix updating note detail after change from another client, closes #3292 --- src/public/app/widgets/note_detail.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/note_detail.js b/src/public/app/widgets/note_detail.js index dd122067d..391b1ec6b 100644 --- a/src/public/app/widgets/note_detail.js +++ b/src/public/app/widgets/note_detail.js @@ -277,7 +277,13 @@ export default class NoteDetailWidget extends NoteContextAwareWidget { // globally, so it gets also to e.g. ribbon components. But this means that the event can be generated multiple // times if the same note is open in several tabs. - if (loadResults.isNoteReloaded(this.noteId, this.componentId) + if (loadResults.isNoteContentReloaded(this.noteId, this.componentId)) { + // probably incorrect event + // calling this.refresh() is not enough since the event needs to be propagated to children as well + // FIXME: create a separate event to force hierarchical refresh + this.triggerEvent('noteTypeMimeChanged', {noteId: this.noteId}); + } + else if (loadResults.isNoteReloaded(this.noteId, this.componentId) && (this.type !== await this.getWidgetType() || this.mime !== this.note.mime)) { this.triggerEvent('noteTypeMimeChanged', {noteId: this.noteId});