Skip to content

Commit

Permalink
fix admin channel create multiple input
Browse files Browse the repository at this point in the history
  • Loading branch information
HUAHUAI23 committed Feb 14, 2025
1 parent 744b768 commit d859892
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,14 @@ export const UpdateChannelModal = function ({
) => {
const lowerCasedInputValue = inputValue.toLowerCase()

return dropdownItems.filter(
(item) =>
!selectedItems.includes(item) && item.name.toLowerCase().includes(lowerCasedInputValue)
// First filter out items that are already selected
const unselectedItems = dropdownItems.filter(
(dropdownItem) =>
!selectedItems.some((selectedItem) => selectedItem.name === dropdownItem.name)
)

// Then filter by input value
return unselectedItems.filter((item) => item.name.toLowerCase().includes(lowerCasedInputValue))
}

const handleModelDropdownItemDisplay = (dropdownItem: Model) => {
Expand Down
6 changes: 1 addition & 5 deletions frontend/providers/aiproxy/app/[lng]/(user)/price/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function Price() {

const [modelOwner, setModelOwner] = useState<string>('')
const [modelType, setModelType] = useState<string>('')
const [modelName, setModelName] = useState<string>('')

const [searchInput, setSearchInput] = useState('')
const debouncedSearch = useDebounce(searchInput, 500)

Expand Down Expand Up @@ -156,10 +156,6 @@ export default function Price() {
})
}, [modelConfigs, modelOwner, modelType, debouncedSearch])

useEffect(() => {
setModelName(debouncedSearch)
}, [debouncedSearch])

return (
<Box w="full" h="full" display="inline-flex" pt="4px" pb="12px" pr="12px" alignItems="center">
<Box w="full" h="full" padding="27px 32px 0px 32px" bg="white" borderRadius="12px">
Expand Down
1 change: 0 additions & 1 deletion frontend/providers/aiproxy/utils/backend/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export async function checkSealosUserIsRealName(headers: Headers): Promise<boole
}
)
const result: RealNameInfoResponse = await response.json()
console.log(result)
if (result.error) {
console.error(result.error)
return false
Expand Down

0 comments on commit d859892

Please sign in to comment.