Skip to content

Commit

Permalink
fix: disable if no cloud meta
Browse files Browse the repository at this point in the history
  • Loading branch information
grutt committed Jun 25, 2024
1 parent 9697add commit cc6dc45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/app/src/pages/auth/hooks/use-cloud-api-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ export default function useCloudApiMeta() {

const cloudMetaQuery = useQuery({
queryKey: ['cloud-metadata:get'],
retry: false,
queryFn: async () => {
const meta = await cloudApi.metadataGet();
return meta;
try {
const meta = await cloudApi.metadataGet();
return meta;
} catch (e) {
console.error('Failed to get cloud metadata', e);
return null;
}
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function ResourceLimits() {

const billingState = useQuery({
...queries.cloud.billing(tenant.metadata.id),
enabled: !!cloudMeta?.data.canBill,
});

const cols = columns();
Expand Down

0 comments on commit cc6dc45

Please sign in to comment.