From 5c2c222252c09dec40d29e37692724699f551413 Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 2 Apr 2019 14:56:37 -0400 Subject: [PATCH] add blocked user to the blocked list on real time --- src/modules/users.js | 6 ++++++ 1 file changed, 6 insertions(+) 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 })