From ed43cd87c9367987aed6ca2a7d3ea12ae526ccdd Mon Sep 17 00:00:00 2001 From: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> Date: Tue, 14 Jan 2025 21:12:12 +0900 Subject: ノートのリンクをリモートのサーバーのURLとしてもコピーできるように (#15091) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(frontend): ノートのリンクをリモートのサーバーのURLとしてコピーできるように * 出し分けのロジックを1箇所に統一 * docs: CHANGELOGの内容をコミット内容に合わせる * docs: reverts 11d1b95 per https://github.com/misskey-dev/misskey/pull/13566#discussion_r1589103356 * chore: 調整 * chore: 調整2 --------- Co-authored-by: Kisaragi Marine Co-authored-by: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Co-authored-by: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --- packages/frontend/src/scripts/get-note-menu.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'packages/frontend/src') diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index e131cf5156..bc504077b0 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -237,11 +237,6 @@ export function getNoteMenu(props: { os.success(); } - function copyLink(): void { - copyToClipboard(`${url}/notes/${appearNote.id}`); - os.success(); - } - function togglePin(pin: boolean): void { os.apiWithDialog(pin ? 'i/pin' : 'i/unpin', { noteId: appearNote.id, @@ -322,6 +317,13 @@ export function getNoteMenu(props: { if (appearNote.url || appearNote.uri) { menuItems.push({ + icon: 'ti ti-link', + text: i18n.ts.copyRemoteLink, + action: () => { + copyToClipboard(appearNote.url ?? appearNote.uri); + os.success(); + }, + }, { icon: 'ti ti-external-link', text: i18n.ts.showOnRemote, action: () => { @@ -474,6 +476,13 @@ export function getNoteMenu(props: { if (appearNote.url || appearNote.uri) { menuItems.push({ + icon: 'ti ti-link', + text: i18n.ts.copyRemoteLink, + action: () => { + copyToClipboard(appearNote.url ?? appearNote.uri); + os.success(); + }, + }, { icon: 'ti ti-external-link', text: i18n.ts.showOnRemote, action: () => { -- cgit v1.2.3-freya