fix(web): gate zone-records fetch to no-template case; wait for domains load before branching

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-05 12:28:07 +07:00
parent c2832348f8
commit 137113cbe6
3 changed files with 44 additions and 3 deletions
+2 -2
View File
@@ -130,12 +130,12 @@ export function useCheckDomain(id: string, enabled = true) {
enabled: !!project && !!id && enabled,
})
}
export function useZoneRecords(id: string) {
export function useZoneRecords(id: string, enabled = true) {
const { project } = useAuth()
return useQuery({
queryKey: ["zoneRecords", project?.id, id],
queryFn: () => api.zoneRecords(project!.id, id),
enabled: !!project && !!id,
enabled: !!project && !!id && enabled,
})
}
export function useCreateTemplateFromZone() {