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

Function handleToggleStatus

src/bases/kanbanCardActions.ts:86–104  ·  view source on GitHub ↗
(
	task: TaskInfo,
	event: MouseEvent,
	plugin: TaskNotesPlugin
)

Source from the content-addressed store, hash-verified

84}
85
86async function handleToggleStatus(
87 task: TaskInfo,
88 event: MouseEvent,
89 plugin: TaskNotesPlugin
90): Promise<void> {
91 try {
92 if (task.recurrence) {
93 await plugin.toggleRecurringTaskComplete(task, getKanbanTaskActionDate(task));
94 } else {
95 await plugin.toggleTaskStatus(task);
96 }
97 } catch (error) {
98 tasknotesLogger.error("[TaskNotes][KanbanView] Failed to toggle status", {
99 category: "internal",
100 operation: "toggle-status",
101 error: error,
102 });
103 }
104}
105
106export function getKanbanTaskActionDate(task: TaskInfo): Date {
107 const dateStr = getDatePart(task.scheduled || task.due || "");

Callers 1

handleKanbanCardActionFunction · 0.85

Calls 4

getKanbanTaskActionDateFunction · 0.85
toggleTaskStatusMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected