yandere_fe/src/components/retweet_button/retweet_button.js

36 lines
865 B
JavaScript
Raw Normal View History

const RetweetButton = {
2018-08-09 09:46:18 -07:00
props: ['status', 'loggedIn', 'visibility'],
data () {
return {
hidePostStatsLocal: typeof this.$store.state.config.hidePostStats == 'undefined'
? this.$store.state.instance.hidePostStats
: this.$store.state.config.hidePostStats,
animated: false
}
},
methods: {
retweet () {
2016-11-13 08:09:16 -08:00
if (!this.status.repeated) {
this.$store.dispatch('retweet', {id: this.status.id})
2018-06-14 02:00:11 -07:00
} else {
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: {
classes () {
return {
'retweeted': this.status.repeated,
2018-06-14 14:17:36 -07:00
'retweeted-empty': !this.status.repeated,
'animate-spin': this.animated
}
}
}
}
export default RetweetButton