yandere_fe/src/components/retweet_button/retweet_button.js

34 lines
725 B
JavaScript
Raw Normal View History

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