fix: remove search by packageName (#2901)

This commit is contained in:
jack zhang 2023-10-24 10:24:31 +08:00 committed by GitHub
parent ab9457c7fc
commit 741e220fd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,14 +75,17 @@ const LocalPlugins = () => {
const pluginList = useMemo(() => { const pluginList = useMemo(() => {
let list = filterList[filterIndex]?.list || []; let list = filterList[filterIndex]?.list || [];
if (debouncedSearchValue) { const searchLowerCaseValue = debouncedSearchValue.toLocaleLowerCase().trim();
if (searchLowerCaseValue) {
list = _.filter( list = _.filter(
list, list,
(item) => (item) =>
item.name?.includes(debouncedSearchValue) || String(item.displayName || '')
item.description?.includes(debouncedSearchValue) || .toLocaleLowerCase()
item.displayName?.includes(debouncedSearchValue) || .includes(searchLowerCaseValue) ||
item.packageName?.includes(debouncedSearchValue), String(item.description || '')
.toLocaleLowerCase()
.includes(searchLowerCaseValue),
); );
} }
return list; return list;