about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/ui/containers/status_list_container.js
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-09-02 11:57:06 +0200
committerGitHub <noreply@github.com>2022-09-02 11:57:06 +0200
commit2a46fcc3ed6b9c013c549d7bcd3f1827ec8c306c (patch)
tree0e4729d2b93ca14b4810c3816949bc4c6c915aab /app/javascript/flavours/glitch/features/ui/containers/status_list_container.js
parentd4e63cd980a87b7bdbde57124d230e7e60ec38f1 (diff)
Fix regexp filtering in pinned community/public TLs (#1840)
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/containers/status_list_container.js')
-rw-r--r--app/javascript/flavours/glitch/features/ui/containers/status_list_container.js20
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']),