MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / applySubtaskChanges

Method applySubtaskChanges

src/modals/TaskEditModal.ts:747–777  ·  view source on GitHub ↗
(task: TaskInfo)

Source from the content-addressed store, hash-verified

745 }
746
747 protected async applySubtaskChanges(task: TaskInfo): Promise<void> {
748 const currentTaskFile = this.app.vault.getAbstractFileByPath(task.path);
749 if (!(currentTaskFile instanceof TFile)) return;
750
751 const result = await applyTaskEditSubtaskChanges({
752 parentTaskFile: currentTaskFile,
753 selectedSubtaskFiles: this.selectedSubtaskFiles,
754 initialSubtaskFiles: this.initialSubtaskFiles,
755 getTaskInfo: (path) => this.plugin.cacheManager.getTaskInfo(path),
756 buildProjectReference: (parentTaskFile, subtaskPath) =>
757 this.buildProjectReference(parentTaskFile, subtaskPath),
758 updateTaskProjects: (subtaskInfo, updatedProjects) =>
759 this.plugin.updateTaskProperty(subtaskInfo, "projects", updatedProjects),
760 onAddError: (error) => {
761 tasknotesLogger.error("Failed to add subtask relation:", {
762 category: "persistence",
763 operation: "add-subtask-relation",
764 error: error,
765 });
766 },
767 onRemoveError: (error) => {
768 tasknotesLogger.error("Failed to remove subtask relation:", {
769 category: "persistence",
770 operation: "remove-subtask-relation",
771 error: error,
772 });
773 },
774 });
775
776 this.initialSubtaskFiles = result.nextInitialSubtaskFiles;
777 }
778
779 // Start expanded for edit modal - override parent property
780 protected isExpanded = true;

Callers 1

handleSaveMethod · 0.95

Calls 6

getAbstractFileByPathMethod · 0.80
buildProjectReferenceMethod · 0.80
updateTaskPropertyMethod · 0.80
errorMethod · 0.80
getTaskInfoMethod · 0.65

Tested by

no test coverage detected