ihba updates

This commit is contained in:
sadposter 2020-05-08 14:38:46 +01:00
parent 7a0e554daf
commit 10153e692e
22 changed files with 1179 additions and 2 deletions

View file

@ -81,6 +81,10 @@ const showReblogs = (store, userId) => {
.then((relationship) => store.commit('updateUserRelationship', [relationship]))
}
const fetchMascot = (store) => {
return store.rootState.api.backendInteractor.fetchMascot()
.then(({ url }) => store.commit('updateMascot', url))
}
const muteDomain = (store, domain) => {
return store.rootState.api.backendInteractor.muteDomain({ domain })
.then(() => store.commit('addDomainMute', domain))
@ -179,6 +183,9 @@ export const mutations = {
state.currentUser.muteIds.push(muteId)
}
},
updateMascot (state, mascotUrl) {
state.currentUser.mascot = mascotUrl
},
saveDomainMutes (state, domainMutes) {
state.currentUser.domainMutes = domainMutes
},
@ -318,6 +325,9 @@ const users = {
unmuteUsers (store, ids = []) {
return Promise.all(ids.map(id => unmuteUser(store, id)))
},
fetchMascot (store) {
return fetchMascot(store)
},
fetchDomainMutes (store) {
return store.rootState.api.backendInteractor.fetchDomainMutes()
.then((domainMutes) => {