fix: update connection handling in ProxyHostForm and improve tooltip descriptions in useDocker

This commit is contained in:
Wikid82
2025-11-21 16:29:42 -05:00
parent a5fd7b02f3
commit c52c96df69
2 changed files with 11 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
import { useQuery } from '@tanstack/react-query'
import { dockerApi } from '../api/docker'
export function useDocker(host?: string) {
export function useDocker(host?: string | null) {
const {
data: containers = [],
isLoading,
@@ -9,7 +9,8 @@ export function useDocker(host?: string) {
refetch,
} = useQuery({
queryKey: ['docker-containers', host],
queryFn: () => dockerApi.listContainers(host),
queryFn: () => dockerApi.listContainers(host || undefined),
enabled: host !== null, // Disable if host is explicitly null
retry: 1, // Don't retry too much if docker is not available
})