Skip to content

Commit

Permalink
fix: remove flow call quota API in useUserQuota hook
Browse files Browse the repository at this point in the history
  • Loading branch information
lethemanh committed Dec 4, 2024
1 parent f4ed433 commit 4c05cf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,5 @@ export const useUserQuota = () => {
setQuota(data)
}, []);

useEffect(() => {
getQuota();
}, []);


return { quota, getQuota };
};
7 changes: 6 additions & 1 deletion tdrive/frontend/src/app/views/client/common/disk-usage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4c05cf9

Please sign in to comment.