add unretweet action to statuses.js

This commit is contained in:
Francis Dinh 2018-06-14 17:17:36 -04:00
parent d05fcfa1a8
commit 556eb4b8a3
2 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,7 @@ const RetweetButton = {
classes () {
return {
'retweeted': this.status.repeated,
'retweeted-empty': !this.status.repeated,
'animate-spin': this.animated
}
}

View File

@ -388,6 +388,10 @@ const statuses = {
commit('setRetweeted', { status, value: true })
apiService.retweet({ id: status.id, credentials: rootState.users.currentUser.credentials })
},
unretweet ({ rootState, commit }, status) {
commit('setRetweeted', { status, value: false })
apiService.unretweet({ id: status.id, credentials: rootState.users.currentUser.credentials })
},
queueFlush ({ rootState, commit }, { timeline, id }) {
commit('queueFlush', { timeline, id })
}