From 2a46fcc3ed6b9c013c549d7bcd3f1827ec8c306c Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 2 Sep 2022 11:57:06 +0200 Subject: Fix regexp filtering in pinned community/public TLs (#1840) --- .../features/ui/containers/status_list_container.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'app/javascript/flavours/glitch/features/ui/containers/status_list_container.js') diff --git a/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js b/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js index 0828e3cb0..53c3b8f39 100644 --- a/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js +++ b/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js @@ -6,20 +6,8 @@ import { createSelector } from 'reselect'; import { debounce } from 'lodash'; import { me } from 'flavours/glitch/util/initial_state'; -const normalizeTimelineId = timelineId => { - if (timelineId.startsWith('public:')) { - return 'public'; - } - - if (timelineId.startsWith('community:')) { - return 'community'; - } - - return timelineId; -}; - const getRegex = createSelector([ - (state, { type }) => state.getIn(['settings', normalizeTimelineId(type), 'regex', 'body']), + (state, { regex }) => regex, ], (rawRegex) => { let regex = null; @@ -32,7 +20,7 @@ const getRegex = createSelector([ }); const makeGetStatusIds = (pending = false) => createSelector([ - (state, { type }) => state.getIn(['settings', normalizeTimelineId(type)], ImmutableMap()), + (state, { type }) => state.getIn(['settings', type], ImmutableMap()), (state, { type }) => state.getIn(['timelines', type, pending ? 'pendingItems' : 'items'], ImmutableList()), (state) => state.get('statuses'), getRegex, @@ -70,8 +58,8 @@ const makeMapStateToProps = () => { const getStatusIds = makeGetStatusIds(); const getPendingStatusIds = makeGetStatusIds(true); - const mapStateToProps = (state, { timelineId }) => ({ - statusIds: getStatusIds(state, { type: timelineId }), + const mapStateToProps = (state, { timelineId, regex }) => ({ + statusIds: getStatusIds(state, { type: timelineId, regex }), isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true), isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false), hasMore: state.getIn(['timelines', timelineId, 'hasMore']), -- cgit