diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-09-02 11:57:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-02 11:57:06 +0200 |
commit | 2a46fcc3ed6b9c013c549d7bcd3f1827ec8c306c (patch) | |
tree | 0e4729d2b93ca14b4810c3816949bc4c6c915aab /app/javascript/flavours/glitch/features/ui | |
parent | d4e63cd980a87b7bdbde57124d230e7e60ec38f1 (diff) |
Fix regexp filtering in pinned community/public TLs (#1840)
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui')
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/containers/status_list_container.js | 20 |
1 files changed, 4 insertions, 16 deletions
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']), |