fix(useAgent): handle fake agent id to prevent unnecessary API calls

This commit is contained in:
icarus 2025-09-22 00:16:19 +08:00
parent 3816076464
commit 1833092998

View File

@ -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)