Add timed-mute functionality
This commit is contained in:
parent
95c15fca22
commit
228a9afdf5
7 changed files with 72 additions and 18 deletions
|
|
@ -61,13 +61,16 @@ const editUserNote = (store, { id, comment }) => {
|
|||
.then((relationship) => store.commit('updateUserRelationship', [relationship]))
|
||||
}
|
||||
|
||||
const muteUser = (store, id) => {
|
||||
const muteUser = (store, args) => {
|
||||
const id = typeof args === 'object' ? args.id : args
|
||||
const expiresIn = typeof args === 'object' ? args.expiresIn : 0
|
||||
|
||||
const predictedRelationship = store.state.relationships[id] || { id }
|
||||
predictedRelationship.muting = true
|
||||
store.commit('updateUserRelationship', [predictedRelationship])
|
||||
store.commit('addMuteId', id)
|
||||
|
||||
return store.rootState.api.backendInteractor.muteUser({ id })
|
||||
return store.rootState.api.backendInteractor.muteUser({ id, expiresIn })
|
||||
.then((relationship) => {
|
||||
store.commit('updateUserRelationship', [relationship])
|
||||
store.commit('addMuteId', id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue