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

Method archiveTask

src/modals/TaskEditModal.ts:617–646  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

615 }
616
617 private async archiveTask(): Promise<void> {
618 try {
619 const updatedTask = await this.plugin.taskService.toggleArchive(this.task);
620
621 // Update the task reference
622 this.task = updatedTask;
623
624 // Notify parent component if callback exists
625 if (this.options.onTaskUpdated) {
626 this.options.onTaskUpdated(updatedTask);
627 }
628
629 // Show success message
630 const actionKey = updatedTask.archived
631 ? "modals.taskEdit.archiveAction.archived"
632 : "modals.taskEdit.archiveAction.unarchived";
633 const actionText = this.t(actionKey);
634 new Notice(this.t("modals.taskEdit.notices.archiveSuccess", { action: actionText }));
635
636 // Close the modal
637 this.close();
638 } catch (error) {
639 tasknotesLogger.error("Failed to archive task:", {
640 category: "persistence",
641 operation: "archive-task",
642 error: error,
643 });
644 new Notice(this.t("modals.taskEdit.notices.archiveFailure"));
645 }
646 }
647
648 private async deleteTask(): Promise<void> {
649 const confirmed = await showConfirmationModal(this.app, {

Callers 1

createActionButtonsMethod · 0.95

Calls 4

closeMethod · 0.95
errorMethod · 0.80
toggleArchiveMethod · 0.45
tMethod · 0.45

Tested by

no test coverage detected