()
| 214 | } |
| 215 | |
| 216 | async onOpen() { |
| 217 | await this.plugin.onReady(); |
| 218 | this.currentFilters = this.loadPersistedFilters(); |
| 219 | |
| 220 | // Listen for task updates to refresh the drill-down modal if it's open |
| 221 | const taskUpdateListener = this.plugin.emitter.on( |
| 222 | EVENT_TASK_UPDATED, |
| 223 | async ({ path, originalTask, updatedTask }) => { |
| 224 | if (!path || !updatedTask || !this.drilldownModal || !this.currentDrilldownData) |
| 225 | return; |
| 226 | |
| 227 | // Check if the updated task is part of the current drill-down data |
| 228 | const taskExists = this.currentDrilldownData.tasks.some( |
| 229 | (task) => |
| 230 | task.path === path || (originalTask && task.path === originalTask.path) |
| 231 | ); |
| 232 | |
| 233 | if (taskExists) { |
| 234 | // Refresh the drill-down modal with updated task data |
| 235 | await this.refreshDrilldownModal(); |
| 236 | } |
| 237 | } |
| 238 | ); |
| 239 | this.listeners.push(taskUpdateListener); |
| 240 | |
| 241 | await this.render(); |
| 242 | } |
| 243 | |
| 244 | async onClose() { |
| 245 | this.contentEl.empty(); |
nothing calls this directly
no test coverage detected