feat: Add error handling for fetching Ollama URL

This commit is contained in:
n4ze3m 2025-01-24 22:36:46 +05:30
parent 97daaf9dc2
commit c2c80e2226

View File

@ -15,9 +15,14 @@ export const SettingsOllama = () => {
const { status } = useQuery({ const { status } = useQuery({
queryKey: ["fetchOllamURL"], queryKey: ["fetchOllamURL"],
queryFn: async () => { queryFn: async () => {
const [ollamaURL] = await Promise.all([getOllamaURL()]) try {
setOllamaURL(ollamaURL) const [ollamaURL] = await Promise.all([getOllamaURL()])
return {} setOllamaURL(ollamaURL)
return {}
} catch (e) {
console.error(e)
return {}
}
} }
}) })