🐛 Fix: 商店搜索失效 (#978)

This commit is contained in:
Ju4tCode 2022-05-15 13:49:56 +08:00 committed by GitHub
parent 90f7c153cb
commit e8b9963ef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -13,7 +13,7 @@ import ModalTitle from "./ModalTitle";
import Paginate from "./Paginate";
import TagComponent from "./Tag";
export default function Adapter(): JSX.Element {
export default function Bot(): JSX.Element {
const [modalOpen, setModalOpen] = useState<boolean>(false);
const {
filter,

View File

@ -13,7 +13,7 @@ import ModalTitle from "./ModalTitle";
import Paginate from "./Paginate";
import TagComponent from "./Tag";
export default function Adapter(): JSX.Element {
export default function Plugin(): JSX.Element {
const [modalOpen, setModalOpen] = useState<boolean>(false);
const {
filter,

View File

@ -19,12 +19,12 @@ export type Obj = {
export function filterObjs(filter: string, objs: Obj[]): Obj[] {
return objs.filter((o) => {
return (
o.module_name?.indexOf(filter) != -1 ||
o.project_link?.indexOf(filter) != -1 ||
o.name.indexOf(filter) != -1 ||
o.desc.indexOf(filter) != -1 ||
o.author.indexOf(filter) != -1 ||
o.tags.filter((t) => t.label.indexOf(filter) != -1).length > 0
o.module_name?.includes(filter) ||
o.project_link?.includes(filter) ||
o.name.includes(filter) ||
o.desc.includes(filter) ||
o.author.includes(filter) ||
o.tags.filter((t) => t.label.includes(filter)).length > 0
);
});
}