MCPcopy
hub / github.com/callumalpass/tasknotes / handleToggleStatus

Method handleToggleStatus

src/bases/TaskListView.ts:2532–2550  ·  view source on GitHub ↗
(task: TaskInfo, event: MouseEvent)

Source from the content-addressed store, hash-verified

2530 }
2531
2532 private async handleToggleStatus(task: TaskInfo, event: MouseEvent): Promise<void> {
2533 try {
2534 if (task.recurrence) {
2535 const actionDate = this.getTaskActionDate(task);
2536 await this.plugin.toggleRecurringTaskComplete(task, actionDate);
2537 } else {
2538 await this.plugin.toggleTaskStatus(task);
2539 }
2540 } catch (error) {
2541 const message = error instanceof Error ? error.message : String(error);
2542 tasknotesLogger.error("[TaskNotes][TaskListView] Failed to toggle status", {
2543 category: "persistence",
2544 operation: "toggle-status",
2545 details: { taskPath: task.path },
2546 error: message,
2547 });
2548 new Notice(`Failed to toggle task status: ${message}`);
2549 }
2550 }
2551
2552 /**
2553 * Determine the date to use when completing a recurring task from Bases.

Callers 1

handleActionClickMethod · 0.95

Calls 4

getTaskActionDateMethod · 0.95
toggleTaskStatusMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected