mutate updated relationship to the store
This commit is contained in:
parent
e9e6daa76e
commit
646d197bf1
|
@ -138,10 +138,10 @@ export default {
|
||||||
this.$store.dispatch('unmuteUser', this.user.id)
|
this.$store.dispatch('unmuteUser', this.user.id)
|
||||||
},
|
},
|
||||||
subscribeUser () {
|
subscribeUser () {
|
||||||
return this.$store.state.api.backendInteractor.subscribeUser(this.user.id)
|
return this.$store.dispatch('subscribeUser', this.user.id)
|
||||||
},
|
},
|
||||||
unsubscribeUser () {
|
unsubscribeUser () {
|
||||||
return this.$store.state.api.backendInteractor.unsubscribeUser(this.user.id)
|
return this.$store.dispatch('unsubscribeUser', this.user.id)
|
||||||
},
|
},
|
||||||
setProfileView (v) {
|
setProfileView (v) {
|
||||||
if (this.switcher) {
|
if (this.switcher) {
|
||||||
|
|
|
@ -305,6 +305,14 @@ const users = {
|
||||||
clearFollowers ({ commit }, userId) {
|
clearFollowers ({ commit }, userId) {
|
||||||
commit('clearFollowers', userId)
|
commit('clearFollowers', userId)
|
||||||
},
|
},
|
||||||
|
subscribeUser ({ rootState, commit }, id) {
|
||||||
|
return rootState.api.backendInteractor.subscribeUser(id)
|
||||||
|
.then((relationship) => commit('updateUserRelationship', [relationship]))
|
||||||
|
},
|
||||||
|
unsubscribeUser ({ rootState, commit }, id) {
|
||||||
|
return rootState.api.backendInteractor.unsubscribeUser(id)
|
||||||
|
.then((relationship) => commit('updateUserRelationship', [relationship]))
|
||||||
|
},
|
||||||
registerPushNotifications (store) {
|
registerPushNotifications (store) {
|
||||||
const token = store.state.currentUser.credentials
|
const token = store.state.currentUser.credentials
|
||||||
const vapidPublicKey = store.rootState.instance.vapidPublicKey
|
const vapidPublicKey = store.rootState.instance.vapidPublicKey
|
||||||
|
|
Loading…
Reference in New Issue