From 560b7ebe35c8b30401e680166e01260e02a9f6f0 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Feb 2025 18:32:53 +0200 Subject: [PATCH] refactor(client): use workaround for TS error --- .../widgets/buttons/attachments_actions.ts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) 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() {