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

Method handleDelete

src/modals/TimeblockInfoModal.ts:560–586  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

558 }
559
560 private async handleDelete(): Promise<void> {
561 // Show confirmation dialog
562 const confirmed = await this.showDeleteConfirmation();
563 if (!confirmed) return;
564
565 try {
566 await this.deleteTimeblockFromDailyNote();
567
568 // Signal immediate update before triggering data change
569 this.onChange?.();
570
571 // Refresh calendar views
572 this.plugin.emitter.trigger("data-changed");
573
574 new Notice(
575 this.translate("notices.timeblockDeletedSuccess", { title: this.timeblock.title })
576 );
577 this.close();
578 } catch (error) {
579 tasknotesLogger.error("Error deleting timeblock:", {
580 category: "internal",
581 operation: "deleting-timeblock",
582 error: error,
583 });
584 new Notice(this.translate("notices.timeblockDeleteFailed"));
585 }
586 }
587
588 private async showDeleteConfirmation(): Promise<boolean> {
589 return new Promise((resolve) => {

Callers 1

onOpenMethod · 0.95

Calls 7

errorMethod · 0.80
triggerMethod · 0.65
translateMethod · 0.65
closeMethod · 0.65
onChangeMethod · 0.45

Tested by

no test coverage detected