diff --git a/locales/en-US.yml b/locales/en-US.yml index 084f6b23b..6de314114 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -45,6 +45,7 @@ pin: "Pin to profile" unpin: "Unpin from profile" copyContent: "Copy contents" copyLink: "Copy link" +copyLinkRemote: "Copy remote link" copyLinkRenote: "Copy renote link" delete: "Delete" deleteAndEdit: "Delete and edit" diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index b273bd36f..f8d6162a8 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -125,6 +125,17 @@ export function getCopyNoteLinkMenu(note: Misskey.entities.Note, text: string): }; } +export function getCopyNoteLinkRemoteMenu(note: misskey.entities.Note, text: string): MenuItem { + return note.url ? { + icon: 'ti ti-link', + text, + action: (): void => { + copyToClipboard(note.url); + os.success(); + }, + } : undefined; +} + export function getNoteMenu(props: { note: Misskey.entities.Note; translation: Ref; @@ -279,6 +290,7 @@ export function getNoteMenu(props: { text: i18n.ts.copyContent, action: copyContent, }, getCopyNoteLinkMenu(appearNote, i18n.ts.copyLink) + , getCopyNoteLinkRemoteMenu(appearNote, i18n.ts.copyLinkRemote) , (appearNote.url || appearNote.uri) ? { icon: 'ti ti-external-link', text: i18n.ts.showOnRemote, @@ -419,6 +431,7 @@ export function getNoteMenu(props: { text: i18n.ts.copyContent, action: copyContent, }, getCopyNoteLinkMenu(appearNote, i18n.ts.copyLink) + , getCopyNoteLinkRemoteMenu(appearNote, i18n.ts.copyLinkRemote) , (appearNote.url || appearNote.uri) ? { icon: 'ti ti-external-link', text: i18n.ts.showOnRemote,