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

Function createReminderClickHandler

src/ui/taskCardActions.ts:161–185  ·  view source on GitHub ↗
(task: TaskInfo, plugin: TaskNotesPlugin)

Source from the content-addressed store, hash-verified

159 * Creates a click handler for reminder indicators.
160 */
161export function createReminderClickHandler(task: TaskInfo, plugin: TaskNotesPlugin): () => void {
162 return () => {
163 const modal = new ReminderModal(plugin.app, plugin, task, (reminders) => {
164 void (async () => {
165 const logger = getTaskCardActionLogger(plugin);
166 try {
167 await plugin.updateTaskProperty(
168 task,
169 "reminders",
170 reminders.length > 0 ? reminders : undefined
171 );
172 } catch (error) {
173 logger.error("Error updating reminders", {
174 category: "persistence",
175 operation: "update-reminders",
176 details: { taskPath: task.path, reminderCount: reminders.length },
177 error,
178 });
179 new Notice("Failed to update reminders");
180 }
181 })();
182 });
183 modal.open();
184 };
185}
186
187/**
188 * Creates a click handler for project indicators.

Calls 4

getTaskCardActionLoggerFunction · 0.85
updateTaskPropertyMethod · 0.80
errorMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected