kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'filters-v2' into 'develop'
Fix v2 filters See merge request soapbox-pub/soapbox!2462environments/review-develop-3zknud/deployments/3238
commit
4de4af6074
|
@ -70,8 +70,8 @@ const Filters = () => {
|
|||
emptyMessage={emptyMessage}
|
||||
itemClassName='pb-4 last:pb-0'
|
||||
>
|
||||
{filters.map((filter, i) => (
|
||||
<div className='rounded-lg bg-gray-100 p-4 dark:bg-primary-800'>
|
||||
{filters.map((filter) => (
|
||||
<div key={filter.id} className='rounded-lg bg-gray-100 p-4 dark:bg-primary-800'>
|
||||
<Stack space={2}>
|
||||
<Stack className='grow' space={1}>
|
||||
<Text weight='medium'>
|
||||
|
|
|
@ -159,23 +159,6 @@ const checkFiltered = (index: string, filters: ImmutableList<FilterEntity>) =>
|
|||
if (regex.test(index)) return result.concat(filter.title);
|
||||
return result;
|
||||
}, ImmutableList<string>())), ImmutableList<string>());
|
||||
// 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);
|
||||
|
|
Ładowanie…
Reference in New Issue