2020-10-19 19:38:49 +03:00
|
|
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
|
|
import { faRetweet } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
|
|
|
|
library.add(faRetweet)
|
2019-09-29 22:33:15 +03:00
|
|
|
|
2016-11-13 16:42:56 +01:00
|
|
|
const RetweetButton = {
|
2018-08-09 16:46:18 +00:00
|
|
|
props: ['status', 'loggedIn', 'visibility'],
|
2017-03-08 21:45:40 -07:00
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
animated: false
|
|
|
|
}
|
|
|
|
},
|
2016-11-13 16:42:56 +01:00
|
|
|
methods: {
|
|
|
|
retweet () {
|
2016-11-13 17:09:16 +01:00
|
|
|
if (!this.status.repeated) {
|
2019-07-05 10:02:14 +03:00
|
|
|
this.$store.dispatch('retweet', { id: this.status.id })
|
2018-06-14 05:00:11 -04:00
|
|
|
} else {
|
2019-07-05 10:02:14 +03:00
|
|
|
this.$store.dispatch('unretweet', { id: this.status.id })
|
2016-11-13 17:09:16 +01:00
|
|
|
}
|
2017-03-08 21:45:40 -07:00
|
|
|
this.animated = true
|
|
|
|
setTimeout(() => {
|
|
|
|
this.animated = false
|
|
|
|
}, 500)
|
2016-11-13 16:42:56 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
2020-09-29 10:18:37 +00:00
|
|
|
mergedConfig () {
|
|
|
|
return this.$store.getters.mergedConfig
|
|
|
|
}
|
2016-11-13 16:42:56 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default RetweetButton
|