diff --git a/tdrive/frontend/src/app/features/users/hooks/use-user-quota.ts b/tdrive/frontend/src/app/features/users/hooks/use-user-quota.ts index 6ed4779a3..c3e52228c 100644 --- a/tdrive/frontend/src/app/features/users/hooks/use-user-quota.ts +++ b/tdrive/frontend/src/app/features/users/hooks/use-user-quota.ts @@ -37,10 +37,5 @@ export const useUserQuota = () => { setQuota(data) }, []); - useEffect(() => { - getQuota(); - }, []); - - return { quota, getQuota }; }; diff --git a/tdrive/frontend/src/app/views/client/common/disk-usage.tsx b/tdrive/frontend/src/app/views/client/common/disk-usage.tsx index 18550e325..65829ce26 100644 --- a/tdrive/frontend/src/app/views/client/common/disk-usage.tsx +++ b/tdrive/frontend/src/app/views/client/common/disk-usage.tsx @@ -16,7 +16,12 @@ const DiskUsage = () => { const [usedBytes, setUsedBytes] = useState(0); const [totalBytes, setTotalBytes] = useState(0); - const { quota } = useUserQuota() + const { quota, getQuota } = useUserQuota(); + + useEffect(() => { + getQuota(); + }, []) + useEffect(() => { if (FeatureTogglesService.isActiveFeatureName(FeatureNames.COMPANY_USER_QUOTA)) { setUsed(Math.round(quota.used / quota.total * 100))