diff --git a/src/public/app/widgets/buttons/attachments_actions.ts b/src/public/app/widgets/buttons/attachments_actions.ts index edb37b72d..efacf48fe 100644 --- a/src/public/app/widgets/buttons/attachments_actions.ts +++ b/src/public/app/widgets/buttons/attachments_actions.ts @@ -10,6 +10,7 @@ import utils from "../../services/utils.js"; import { Dropdown } from "bootstrap"; import type attachmentsApiRoute from "../../../../routes/api/attachments.js" import type FAttachment from "../../entities/fattachment.js"; +import type AttachmentDetailWidget from "../attachment_detail.js"; const TPL = ` - + `; @@ -150,10 +151,9 @@ export default class AttachmentActionsWidget extends BasicWidget { } async copyAttachmentLinkToClipboardCommand() { - //TriliumNextTODO: the parent here is AttachmentDetailWidget - //how can we pass that to the generic TypedComponent? - //@ts-ignore - TypedComponent - this.parent?.copyAttachmentLinkToClipboard(); + if (this.parent && "copyAttachmentLinkToClipboard" in this.parent) { + (this.parent as AttachmentDetailWidget).copyAttachmentLinkToClipboard(); + } } async deleteAttachmentCommand() {