diff --git a/src/public/app/services/load_results.ts b/src/public/app/services/load_results.ts index e91dfde86..25f3b30ec 100644 --- a/src/public/app/services/load_results.ts +++ b/src/public/app/services/load_results.ts @@ -183,6 +183,14 @@ export default class LoadResults { return this.contentNoteIdToComponentId.find((l) => l.noteId === noteId && l.componentId !== componentId); } + isTaskListReloaded(parentNoteId: string) { + if (!parentNoteId) { + return false; + } + + return !!this.taskRows.find((tr) => tr.parentNoteId === parentNoteId); + } + addOption(name: string) { this.optionNames.push(name); } diff --git a/src/public/app/widgets/type_widgets/task_list.ts b/src/public/app/widgets/type_widgets/task_list.ts index 037ec5739..6c4f1aeda 100644 --- a/src/public/app/widgets/type_widgets/task_list.ts +++ b/src/public/app/widgets/type_widgets/task_list.ts @@ -121,7 +121,9 @@ export default class TaskListWidget extends TypeWidget { } entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) { - console.log("Update", loadResults); + if (this.noteId && loadResults.isTaskListReloaded(this.noteId)) { + this.refresh(); + } } }