mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 02:52:27 +08:00
feat(tasks): implement basic refresh support
This commit is contained in:
parent
c0d3e8d834
commit
62c96fc95e
@ -183,6 +183,14 @@ export default class LoadResults {
|
|||||||
return this.contentNoteIdToComponentId.find((l) => l.noteId === noteId && l.componentId !== componentId);
|
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) {
|
addOption(name: string) {
|
||||||
this.optionNames.push(name);
|
this.optionNames.push(name);
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,9 @@ export default class TaskListWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
||||||
console.log("Update", loadResults);
|
if (this.noteId && loadResults.isTaskListReloaded(this.noteId)) {
|
||||||
|
this.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user