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 {
|
2018-09-04 00:41:37 +01:00
|
|
|
hidePostStatsLocal: this.$store.state.config.hidePostStats,
|
2017-03-08 21:45:40 -07:00
|
|
|
animated: false
|
|
|
|
}
|
|
|
|
},
|
2016-11-13 16:42:56 +01:00
|
|
|
methods: {
|
|
|
|
retweet () {
|
2016-11-13 17:09:16 +01:00
|
|
|
if (!this.status.repeated) {
|
|
|
|
this.$store.dispatch('retweet', {id: this.status.id})
|
2018-06-14 05:00:11 -04:00
|
|
|
} else {
|
|
|
|
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: {
|
|
|
|
classes () {
|
|
|
|
return {
|
2017-03-08 21:45:40 -07:00
|
|
|
'retweeted': this.status.repeated,
|
2018-06-14 17:17:36 -04:00
|
|
|
'retweeted-empty': !this.status.repeated,
|
2017-03-08 21:45:40 -07:00
|
|
|
'animate-spin': this.animated
|
2016-11-13 16:42:56 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default RetweetButton
|