From d211d4f9349a7331e4170bf3db711c644d005e17 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Fri, 17 Jul 2020 14:15:39 +0300 Subject: [PATCH] Fix optimistc update for deleting users --- src/store/modules/users.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/store/modules/users.js b/src/store/modules/users.js index 83d2ceee..4db8042f 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -193,9 +193,10 @@ const users = { } catch (_e) { return } - const deletedUsersIds = users.map(deletedUser => deletedUser.id) - const updatedUsers = state.fetchedUsers.filter(user => !deletedUsersIds.includes(user.id)) - commit('SET_USERS', updatedUsers) + const updatedUsers = users.map(user => { + return { ...user, deactivated: true } + }) + commit('SWAP_USERS', updatedUsers) if (_userId) { dispatch('FetchUserProfile', { userId: _userId, godmode: false })