From 70d18eba598b294ffbfa277c42163e23213dbe93 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Mon, 15 Nov 2021 12:58:17 +0800 Subject: [PATCH] Remove "same array" check now that USER_STATE_POPULATE only runs when there is new data. --- ui/redux/reducers/blocked.js | 8 -------- ui/redux/reducers/tags.js | 10 +--------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/ui/redux/reducers/blocked.js b/ui/redux/reducers/blocked.js index fff8f7ba3..b5a08b41b 100644 --- a/ui/redux/reducers/blocked.js +++ b/ui/redux/reducers/blocked.js @@ -26,14 +26,6 @@ export default handleActions( [ACTIONS.USER_STATE_POPULATE]: (state: BlocklistState, action: { data: { blocked: ?Array } }) => { const { blocked } = action.data; const sanitizedBlocked = blocked && blocked.filter((e) => typeof e === 'string'); - - const next = sanitizedBlocked; - const prev = state.blockedChannels; - - if (next && prev && prev.length === next.length && prev.every((value, index) => value === next[index])) { - return state; - } - return { ...state, blockedChannels: sanitizedBlocked || state.blockedChannels, diff --git a/ui/redux/reducers/tags.js b/ui/redux/reducers/tags.js index c3be1baf2..df070639b 100644 --- a/ui/redux/reducers/tags.js +++ b/ui/redux/reducers/tags.js @@ -65,15 +65,7 @@ export default handleActions( [ACTIONS.USER_STATE_POPULATE]: (state: TagState, action: { data: { tags: ?Array } }) => { const { tags } = action.data; if (Array.isArray(tags)) { - const next = tags && tags.filter((tag) => typeof tag === 'string'); - const prev = state.followedTags; - - if (next && prev && prev.length === next.length && prev.every((value, index) => value === next[index])) { - // No changes - return state; - } - - // New state + const next = tags.filter((tag) => typeof tag === 'string'); return { ...state, followedTags: next || [],