(task: TaskInfo, plugin: TaskNotesPlugin)
| 159 | * Creates a click handler for reminder indicators. |
| 160 | */ |
| 161 | export 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. |
no test coverage detected