mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
🛠️ Refactor SVG filtering logic in load function; ensure base data is used for `searchWithFuse`
This commit is contained in:
+2
-1
@@ -23,7 +23,8 @@ export const load: Load = ({ url }) => {
|
||||
svg.title.toLowerCase().includes(searchParam.toLowerCase()),
|
||||
);
|
||||
} else {
|
||||
filteredSvgs = searchWithFuse(filteredSvgs)
|
||||
const baseData = sortParam ? alphabeticallySorted : latestSorted;
|
||||
filteredSvgs = searchWithFuse(baseData)
|
||||
.search(searchParam)
|
||||
.map((result) => result.item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user