mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 13:59:28 +08:00
fix(useAgent): handle fake agent id to prevent unnecessary API calls
This commit is contained in:
parent
3816076464
commit
1833092998
@ -7,7 +7,7 @@ export const useAgent = (id: string | null) => {
|
||||
const client = useAgentClient()
|
||||
const key = id ? client.agentPaths.withId(id) : null
|
||||
const fetcher = useCallback(async () => {
|
||||
if (!id) {
|
||||
if (!id || id === 'fake') {
|
||||
return null
|
||||
}
|
||||
const result = await client.getAgent(id)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user