refactor(client): use workaround for TS error

This commit is contained in:
Elian Doran 2025-02-23 18:32:53 +02:00
parent 4883debd8d
commit 560b7ebe35
No known key found for this signature in database

View File

@ -10,6 +10,7 @@ import utils from "../../services/utils.js";
import { Dropdown } from "bootstrap"; import { Dropdown } from "bootstrap";
import type attachmentsApiRoute from "../../../../routes/api/attachments.js" import type attachmentsApiRoute from "../../../../routes/api/attachments.js"
import type FAttachment from "../../entities/fattachment.js"; import type FAttachment from "../../entities/fattachment.js";
import type AttachmentDetailWidget from "../attachment_detail.js";
const TPL = ` const TPL = `
<div class="dropdown attachment-actions"> <div class="dropdown attachment-actions">
@ -150,10 +151,9 @@ export default class AttachmentActionsWidget extends BasicWidget {
} }
async copyAttachmentLinkToClipboardCommand() { async copyAttachmentLinkToClipboardCommand() {
//TriliumNextTODO: the parent here is AttachmentDetailWidget if (this.parent && "copyAttachmentLinkToClipboard" in this.parent) {
//how can we pass that to the generic TypedComponent<any>? (this.parent as AttachmentDetailWidget).copyAttachmentLinkToClipboard();
//@ts-ignore - TypedComponent<any> }
this.parent?.copyAttachmentLinkToClipboard();
} }
async deleteAttachmentCommand() { async deleteAttachmentCommand() {