diff options
| author | taehoon <th.dev91@gmail.com> | 2019-04-02 14:56:37 -0400 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-04-14 23:44:49 -0400 |
| commit | 5c2c222252c09dec40d29e37692724699f551413 (patch) | |
| tree | 85aea9ef18ccc6798f4d03e4467110bbb4d23e7a | |
| parent | 91844358871e106add0822fc528b4deeaa32c2ec (diff) | |
add blocked user to the blocked list on real time
| -rw-r--r-- | src/modules/users.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index 545b1d58..2c6a0f81 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -132,6 +132,11 @@ export const mutations = { saveBlockIds (state, blockIds) { state.currentUser.blockIds = blockIds }, + addBlockId (state, blockId) { + if (state.currentUser.blockIds.indexOf(blockId) === -1) { + state.currentUser.blockIds.push(blockId) + } + }, updateMutes (state, mutedUsers) { // Reset muted of all fetched users each(state.users, (user) => { user.muted = false }) @@ -215,6 +220,7 @@ const users = { return store.rootState.api.backendInteractor.blockUser(userId) .then((relationship) => { store.commit('updateUserRelationship', [relationship]) + store.commit('addBlockId', userId) store.commit('removeStatus', { timeline: 'friends', userId }) store.commit('removeStatus', { timeline: 'public', userId }) store.commit('removeStatus', { timeline: 'publicAndExternal', userId }) |
