( path: string, options?: UncompleteTaskOptions, context?: TaskNotesMutationContext )
| 2068 | } |
| 2069 | |
| 2070 | async uncompleteTask( |
| 2071 | path: string, |
| 2072 | options?: UncompleteTaskOptions, |
| 2073 | context?: TaskNotesMutationContext |
| 2074 | ): Promise<TaskInfo> { |
| 2075 | const task = await this.requireTask(path); |
| 2076 | const targetStatus = options?.status ?? this.plugin.settings.defaultTaskStatus ?? "open"; |
| 2077 | |
| 2078 | if (!this.plugin.statusManager.isCompletedStatus(task.status) && !options?.status) { |
| 2079 | return copyTaskInfo(task); |
| 2080 | } |
| 2081 | |
| 2082 | const updatedTask = await this.withMutationContext([task.path], context, () => |
| 2083 | this.plugin.taskService.updateProperty(task, "status", targetStatus) |
| 2084 | ); |
| 2085 | return copyTaskInfo(updatedTask); |
| 2086 | } |
| 2087 | |
| 2088 | async startTimeEntry(path: string, context?: TaskNotesMutationContext): Promise<void> { |
| 2089 | await this.startTime(path, undefined, context); |
no test coverage detected