diff options
| author | taehoon <th.dev91@gmail.com> | 2019-04-02 16:23:12 -0400 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-04-14 23:44:50 -0400 |
| commit | 948baba9d351f8e5958e1f1aa7b9065c9c54f026 (patch) | |
| tree | 0a683360521a55fac7ca7c0f1419040ad05e3f51 /src | |
| parent | d58e08cf52c5953914f0bf1b6c9fb120168c6160 (diff) | |
add muted user to the mutes list in real time
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/users.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index 2c6a0f81..b6d8227c 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -145,6 +145,11 @@ export const mutations = { saveMuteIds (state, muteIds) { state.currentUser.muteIds = muteIds }, + addMuteId (state, muteId) { + if (state.currentUser.muteIds.indexOf(muteId) === -1) { + state.currentUser.muteIds.push(muteId) + } + }, setUserForStatus (state, status) { status.user = state.usersObject[status.user.id] }, @@ -240,7 +245,10 @@ const users = { }, muteUser (store, id) { return store.rootState.api.backendInteractor.muteUser(id) - .then((relationship) => store.commit('updateUserRelationship', [relationship])) + .then((relationship) => { + store.commit('updateUserRelationship', [relationship]) + store.commit('addMuteId', id) + }) }, unmuteUser (store, id) { return store.rootState.api.backendInteractor.unmuteUser(id) |
