aboutsummaryrefslogtreecommitdiff
path: root/src/components/extra_buttons
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-04-24 15:34:30 -0400
committertaehoon <th.dev91@gmail.com>2019-05-15 12:04:25 -0400
commitce1d19136de322637695891b11117946664eacd6 (patch)
tree3c03e30e6a0e4f7331a22b2c7bfba606720e7f93 /src/components/extra_buttons
parente8abe1273b5c860b78b219973c2a2926014c0ca5 (diff)
refactor pin/unpin status logic
Diffstat (limited to 'src/components/extra_buttons')
-rw-r--r--src/components/extra_buttons/extra_buttons.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js
index 71f5946d..55a4caad 100644
--- a/src/components/extra_buttons/extra_buttons.js
+++ b/src/components/extra_buttons/extra_buttons.js
@@ -24,19 +24,15 @@ const ExtraButtons = {
},
pinStatus () {
this.refreshPopper()
- this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => {
+ this.$store.dispatch('pinStatus', this.status.id).then((status) => {
if (status.error) {
this.$emit('onError', status.error)
- } else {
- this.$store.dispatch('updatePinned', status)
}
})
},
unpinStatus () {
this.refreshPopper()
- this.$store.state.api.backendInteractor.unpinOwnStatus(this.status.id).then((status) => {
- this.$store.dispatch('updatePinned', status)
- })
+ this.$store.dispatch('unpinStatus', this.status.id)
},
refreshPopper () {
this.showPopper = false