mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-11 13:46:17 +00:00
fix(Patches): update patch name search filter
This commit is contained in:
@@ -10,8 +10,8 @@
|
|||||||
import { createQuery } from '@tanstack/svelte-query';
|
import { createQuery } from '@tanstack/svelte-query';
|
||||||
import { queries } from '$data/api';
|
import { queries } from '$data/api';
|
||||||
|
|
||||||
import Meta from '$lib/components/Meta.svelte';
|
|
||||||
import { JsonLd } from 'svelte-meta-tags';
|
import { JsonLd } from 'svelte-meta-tags';
|
||||||
|
import Meta from '$lib/components/Meta.svelte';
|
||||||
import PackageMenu from './PackageMenu.svelte';
|
import PackageMenu from './PackageMenu.svelte';
|
||||||
import Package from './Package.svelte';
|
import Package from './Package.svelte';
|
||||||
import PatchItem from './PatchItem.svelte';
|
import PatchItem from './PatchItem.svelte';
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
?.replace(/\./g, '')
|
?.replace(/\./g, '')
|
||||||
.replace(/\s/g, '')
|
.replace(/\s/g, '')
|
||||||
.replace(/-/g, '')
|
.replace(/-/g, '')
|
||||||
|
.replace(/_/g, '')
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
|
|
||||||
let timeout: ReturnType<typeof setTimeout>;
|
let timeout: ReturnType<typeof setTimeout>;
|
||||||
@@ -68,7 +69,7 @@
|
|||||||
if (search !== undefined) {
|
if (search !== undefined) {
|
||||||
return (
|
return (
|
||||||
searchString(patch.description, search, /\s/g) ||
|
searchString(patch.description, search, /\s/g) ||
|
||||||
searchString(patch.name, search, /-/g) ||
|
searchString(patch.name, search, /\s/g) ||
|
||||||
patch.compatiblePackages.find((x) => searchString(x.name, search, /\./g))
|
patch.compatiblePackages.find((x) => searchString(x.name, search, /\./g))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -85,6 +86,7 @@
|
|||||||
?.replace(/\./g, '')
|
?.replace(/\./g, '')
|
||||||
.replace(/\s/g, '')
|
.replace(/\s/g, '')
|
||||||
.replace(/-/g, '')
|
.replace(/-/g, '')
|
||||||
|
.replace(/_/g, '')
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
// Update search URL params
|
// Update search URL params
|
||||||
// must use history.pushState instead of goto(), as goto() unselects the search bar
|
// must use history.pushState instead of goto(), as goto() unselects the search bar
|
||||||
|
|||||||
Reference in New Issue
Block a user