mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-09 06:49:02 +08:00
fix(useAgents): use right agents data
This commit is contained in:
parent
136d343c18
commit
64ee5c528b
@ -5,10 +5,10 @@ import { useAgentClient } from './useAgentClient'
|
|||||||
export const useAgents = () => {
|
export const useAgents = () => {
|
||||||
const client = useAgentClient()
|
const client = useAgentClient()
|
||||||
const key = client.agentPaths.base
|
const key = client.agentPaths.base
|
||||||
const { data: agents, error, isLoading } = useSWR(key, () => client.listAgents())
|
const { data, error, isLoading } = useSWR(key, () => client.listAgents())
|
||||||
|
|
||||||
return {
|
return {
|
||||||
agents,
|
agents: data?.agents ?? [],
|
||||||
error,
|
error,
|
||||||
isLoading
|
isLoading
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user