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(() => {
let list = filterList[filterIndex]?.list || [];
if (debouncedSearchValue) {
const searchLowerCaseValue = debouncedSearchValue.toLocaleLowerCase().trim();
if (searchLowerCaseValue) {
list = _.filter(
list,
(item) =>
item.name?.includes(debouncedSearchValue) ||
item.description?.includes(debouncedSearchValue) ||
item.displayName?.includes(debouncedSearchValue) ||
item.packageName?.includes(debouncedSearchValue),
String(item.displayName || '')
.toLocaleLowerCase()
.includes(searchLowerCaseValue) ||
String(item.description || '')
.toLocaleLowerCase()
.includes(searchLowerCaseValue),
);
}
return list;