From 1e18f787569e64fe0cecc494d93a824912d8b524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 21 Apr 2023 23:38:07 +0200 Subject: [PATCH] Fix v2 filters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/features/filters/index.tsx | 4 ++-- app/soapbox/selectors/index.ts | 19 +------------------ 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/app/soapbox/features/filters/index.tsx b/app/soapbox/features/filters/index.tsx index 46eba410b..5aadf1795 100644 --- a/app/soapbox/features/filters/index.tsx +++ b/app/soapbox/features/filters/index.tsx @@ -70,8 +70,8 @@ const Filters = () => { emptyMessage={emptyMessage} itemClassName='pb-4 last:pb-0' > - {filters.map((filter, i) => ( -
+ {filters.map((filter) => ( +
diff --git a/app/soapbox/selectors/index.ts b/app/soapbox/selectors/index.ts index 4679c1148..a936ffdf1 100644 --- a/app/soapbox/selectors/index.ts +++ b/app/soapbox/selectors/index.ts @@ -159,23 +159,6 @@ const checkFiltered = (index: string, filters: ImmutableList) => if (regex.test(index)) return result.concat(filter.title); return result; }, ImmutableList())), ImmutableList()); -// const results = -// let expr = escapeRegExp(filter.phrase); - -// if (filter.whole_word) { -// if (/^[\w]/.test(expr)) { -// expr = `\\b${expr}`; -// } - -// if (/[\w]$/.test(expr)) { -// expr = `${expr}\\b`; -// } -// } - -// const regex = new RegExp(expr); - -// if (regex.test(index)) return result.join(filter.phrase); -// return result; type APIStatus = { id: string, username?: string }; @@ -216,7 +199,7 @@ export const makeGetStatus = () => { // @ts-ignore map.set('group', group || null); - if ((features.filters || features.filtersV2) && (accountReblog || accountBase).id !== me) { + if ((features.filters) && (accountReblog || accountBase).id !== me) { const filtered = checkFiltered(statusReblog?.search_index || statusBase.search_index, filters); map.set('filtered', filtered);