aboutsummaryrefslogtreecommitdiff
path: root/src/components/extra_buttons/extra_buttons.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/extra_buttons/extra_buttons.js')
-rw-r--r--src/components/extra_buttons/extra_buttons.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js
index 5ac73e97..e4b19d01 100644
--- a/src/components/extra_buttons/extra_buttons.js
+++ b/src/components/extra_buttons/extra_buttons.js
@@ -1,5 +1,8 @@
+import Popover from '../popover/popover.vue'
+
const ExtraButtons = {
props: [ 'status' ],
+ components: { Popover },
methods: {
deleteStatus () {
const confirmed = window.confirm(this.$t('status.delete_confirm'))
@@ -26,6 +29,11 @@ const ExtraButtons = {
this.$store.dispatch('unmuteConversation', this.status.id)
.then(() => this.$emit('onSuccess'))
.catch(err => this.$emit('onError', err.error.error))
+ },
+ copyLink () {
+ navigator.clipboard.writeText(this.statusLink)
+ .then(() => this.$emit('onSuccess'))
+ .catch(err => this.$emit('onError', err.error.error))
}
},
computed: {
@@ -43,6 +51,9 @@ const ExtraButtons = {
},
canMute () {
return !!this.currentUser
+ },
+ statusLink () {
+ return `${this.$store.state.instance.server}${this.$router.resolve({ name: 'conversation', params: { id: this.status.id } }).href}`
}
}
}