From b4f083a0518f2d3c18f5a4cd4efff1e63b5cb6fe Mon Sep 17 00:00:00 2001 From: Vyrtsev Mikhail Date: Sun, 28 Jul 2019 19:24:19 +0300 Subject: [PATCH] remove redundant mutation --- frontend/app/store/user/actions.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/frontend/app/store/user/actions.ts b/frontend/app/store/user/actions.ts index 8c9ebde3..c72ece19 100644 --- a/frontend/app/store/user/actions.ts +++ b/frontend/app/store/user/actions.ts @@ -114,7 +114,7 @@ export const hideUser = (user: User): StoreAction => (dispatch, getState) }); }; -export const unhideUser = (userId: string): StoreAction => (dispatch, getState) => { +export const unhideUser = (userId: string): StoreAction => (dispatch, _getState) => { if (IS_STORAGE_AVAILABLE) { const hiddenUsers = JSON.parse(getItem(LS_HIDDEN_USERS_KEY) || '{}'); if (hiddenUsers.hasOwnProperty(userId)) { @@ -124,13 +124,8 @@ export const unhideUser = (userId: string): StoreAction => (dispatch, getS } dispatch({ type: USER_UNHIDE, id: userId }); - dispatch({ - type: COMMENTS_PATCH, - ids: Object.values(getState().comments) - .filter(c => c.user.id === userId) - .map(c => c.id), - patch: { hidden: false }, - }); + + // no need for comments patch as comments will be refetched after action }; export const setVerifiedStatus = (id: User['id'], status: boolean): StoreAction> => async (