2016-11-13 15:42:56 +00:00
|
|
|
const RetweetButton = {
|
2018-08-09 16:46:18 +00:00
|
|
|
props: ['status', 'loggedIn', 'visibility'],
|
2017-03-09 04:45:40 +00:00
|
|
|
data () {
|
|
|
|
return {
|
2018-09-03 23:41:37 +00:00
|
|
|
hidePostStatsLocal: this.$store.state.config.hidePostStats,
|
2017-03-09 04:45:40 +00:00
|
|
|
animated: false
|
|
|
|
}
|
|
|
|
},
|
2016-11-13 15:42:56 +00:00
|
|
|
methods: {
|
|
|
|
retweet () {
|
2016-11-13 16:09:16 +00:00
|
|
|
if (!this.status.repeated) {
|
|
|
|
this.$store.dispatch('retweet', {id: this.status.id})
|
2018-06-14 09:00:11 +00:00
|
|
|
} else {
|
|
|
|
this.$store.dispatch('unretweet', {id: this.status.id})
|
2016-11-13 16:09:16 +00:00
|
|
|
}
|
2017-03-09 04:45:40 +00:00
|
|
|
this.animated = true
|
|
|
|
setTimeout(() => {
|
|
|
|
this.animated = false
|
|
|
|
}, 500)
|
2016-11-13 15:42:56 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
classes () {
|
|
|
|
return {
|
2017-03-09 04:45:40 +00:00
|
|
|
'retweeted': this.status.repeated,
|
2018-06-14 21:17:36 +00:00
|
|
|
'retweeted-empty': !this.status.repeated,
|
2017-03-09 04:45:40 +00:00
|
|
|
'animate-spin': this.animated
|
2016-11-13 15:42:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default RetweetButton
|