feat: Improve model search by adding name-based filtering, resolve #1520
搜索模型时,同时搜索模型的名字和 ID
This commit is contained in:
parent
65b30b3b0d
commit
fad3f67678
@ -36,7 +36,11 @@ const PopupContainer: React.FC<Props> = ({ provider: _provider, resolve }) => {
|
||||
const allModels = uniqBy([...systemModels, ...listModels, ...models], 'id')
|
||||
|
||||
const list = allModels.filter((model) => {
|
||||
if (searchText && !model.id.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) {
|
||||
if (
|
||||
searchText &&
|
||||
!model.id.toLocaleLowerCase().includes(searchText.toLocaleLowerCase()) &&
|
||||
!model.name?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())
|
||||
) {
|
||||
return false
|
||||
}
|
||||
switch (filterType) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user