Move poll state handling to its own module
This commit is contained in:
parent
eca533aab6
commit
e5e9bb27f3
6 changed files with 96 additions and 34 deletions
|
@ -582,18 +582,6 @@ const statuses = {
|
|||
]).then(([favoritedByUsers, rebloggedByUsers]) =>
|
||||
commit('addFavsAndRepeats', { id, favoritedByUsers, rebloggedByUsers })
|
||||
)
|
||||
},
|
||||
votePoll ({ rootState, commit }, { id, pollId, choices }) {
|
||||
return rootState.api.backendInteractor.vote(pollId, choices).then(poll => {
|
||||
commit('updateStatusWithPoll', { id, poll })
|
||||
return poll
|
||||
})
|
||||
},
|
||||
refreshPoll ({ rootState, commit }, { id, pollId }) {
|
||||
return rootState.api.backendInteractor.fetchPoll(pollId).then(poll => {
|
||||
commit('updateStatusWithPoll', { id, poll })
|
||||
return poll
|
||||
})
|
||||
}
|
||||
},
|
||||
mutations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue