Skip to content

Commit

Permalink
fix: use instance status too many reqs (#2651)
Browse files Browse the repository at this point in the history
Same as #2650 but for
`useInstanceStatus`, since it followed a similar pattern.
  • Loading branch information
nunogois committed Dec 9, 2022
1 parent 1e8801b commit 1bd95d4
Showing 1 changed file with 1 addition and 6 deletions.
Expand Up @@ -2,7 +2,6 @@ import { IInstanceStatus, InstancePlan } from 'interfaces/instance';
import { useApiGetter } from 'hooks/api/getters/useApiGetter/useApiGetter';
import { formatApiPath } from 'utils/formatPath';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { useEffect } from 'react';

export interface IUseInstanceStatusOutput {
instanceStatus?: IInstanceStatus;
Expand All @@ -20,14 +19,10 @@ export const useInstanceStatus = (): IUseInstanceStatusOutput => {
} = uiConfig;

const { data, refetch, loading, error } = useApiGetter(
'useInstanceStatus',
['useInstanceStatus', UNLEASH_CLOUD],
() => fetchInstanceStatus(UNLEASH_CLOUD)
);

useEffect(() => {
refetch();
}, [refetch, UNLEASH_CLOUD]);

const billingPlans = [
InstancePlan.PRO,
InstancePlan.COMPANY,
Expand Down

0 comments on commit 1bd95d4

Please sign in to comment.