fix: update model list (#1967)

This commit is contained in:
zxhlyh 2024-01-08 18:54:39 +08:00 • committed by GitHub
commit 853cdd741f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 87 additions and 47 deletions

View file

@ -258,14 +258,12 @@ export const useModelProviders = () => {
}
}
export const useUpdateModelProvidersAndModelList = () => {
export const useUpdateModelProviders = () => {
const { mutate } = useSWRConfig()
const updateModelList = useUpdateModelList()
const updateModelProvidersAndModelList = useCallback(() => {
const updateModelProviders = useCallback(() => {
mutate('/workspaces/current/model-providers')
updateModelList(1)
}, [mutate, updateModelList])
}, [mutate])
return updateModelProvidersAndModelList
return updateModelProviders
}