feat: add 'copy original link to this post' menu item (#1318)

This commit is contained in:
Peter Budai 2023-01-19 16:18:08 +01:00 committed by GitHub
parent 61f2237121
commit c200abcc90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View file

@ -42,6 +42,12 @@ const copyLink = async (status: mastodon.v1.Status) => {
await clipboard.copy(url)
}
const copyOriginalLink = async (status: mastodon.v1.Status) => {
const url = status.url
if (url)
await clipboard.copy(url)
}
const { share, isSupported: isShareSupported } = useShare()
const shareLink = async (status: mastodon.v1.Status) => {
const url = getPermalinkUrl(status)
@ -169,6 +175,13 @@ const showFavoritedAndBoostedBy = () => {
@click="copyLink(status)"
/>
<CommonDropdownItem
:text="$t('menu.copy_original_link_to_post')"
icon="i-ri:links-fill"
:command="command"
@click="copyOriginalLink(status)"
/>
<CommonDropdownItem
v-if="isShareSupported"
:text="$t('menu.share_post')"

View file

@ -117,6 +117,7 @@
"block_account": "Block {0}",
"block_domain": "Block domain {0}",
"copy_link_to_post": "Copy link to this post",
"copy_original_link_to_post": "Copy original link to this post",
"delete": "Delete",
"delete_and_redraft": "Delete & re-draft",
"direct_message_account": "Direct message {0}",

View file

@ -172,6 +172,7 @@
"block_account": "Block {0}",
"block_domain": "Block domain {0}",
"copy_link_to_post": "Copy link to this post",
"copy_original_link_to_post": "Copy original link to this post",
"delete": "Delete",
"delete_and_redraft": "Delete & re-draft",
"direct_message_account": "Direct message {0}",