()
| 714 | } |
| 715 | |
| 716 | protected async initializeSubtasks(): Promise<void> { |
| 717 | try { |
| 718 | const taskFile = this.app.vault.getAbstractFileByPath(this.task.path); |
| 719 | if (!(taskFile instanceof TFile)) return; |
| 720 | |
| 721 | const subtasks = |
| 722 | await this.plugin.projectSubtasksService.getTasksLinkedToProject(taskFile); |
| 723 | const sortedSubtasks = this.plugin.projectSubtasksService.sortTasks([...subtasks]); |
| 724 | this.selectedSubtaskFiles = []; |
| 725 | this.initialSubtaskFiles = []; |
| 726 | |
| 727 | for (const subtask of sortedSubtasks) { |
| 728 | const subtaskFile = this.app.vault.getAbstractFileByPath(subtask.path); |
| 729 | if (subtaskFile) { |
| 730 | this.selectedSubtaskFiles.push(subtaskFile); |
| 731 | this.initialSubtaskFiles.push(subtaskFile); |
| 732 | } |
| 733 | } |
| 734 | } catch (error) { |
| 735 | tasknotesLogger.error("Error initializing subtasks:", { |
| 736 | category: "persistence", |
| 737 | operation: "initializing-subtasks", |
| 738 | error: error, |
| 739 | }); |
| 740 | } |
| 741 | } |
| 742 | |
| 743 | protected hasSubtaskChanges(): boolean { |
| 744 | return hasTaskEditSubtaskChanges(this.initialSubtaskFiles, this.selectedSubtaskFiles); |
no test coverage detected