Skip to content

Commit d9ded65

Browse files
authored
fix(desktop): add Copy Link action for chat links (#1835)
1 parent 2aa7398 commit d9ded65

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/desktop/src/main.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as Path from "node:path";
77
import {
88
app,
99
BrowserWindow,
10+
clipboard,
1011
dialog,
1112
ipcMain,
1213
Menu,
@@ -1572,6 +1573,14 @@ function createWindow(): BrowserWindow {
15721573
menuTemplate.push({ type: "separator" });
15731574
}
15741575

1576+
const externalUrl = getSafeExternalUrl(params.linkURL);
1577+
if (externalUrl) {
1578+
menuTemplate.push(
1579+
{ label: "Copy Link", click: () => clipboard.writeText(params.linkURL) },
1580+
{ type: "separator" },
1581+
);
1582+
}
1583+
15751584
menuTemplate.push(
15761585
{ role: "cut", enabled: params.editFlags.canCut },
15771586
{ role: "copy", enabled: params.editFlags.canCopy },

0 commit comments

Comments
 (0)