Skip to content

Commit 4c05cf9

Browse files
committed
fix: remove flow call quota API in useUserQuota hook
1 parent f4ed433 commit 4c05cf9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tdrive/frontend/src/app/features/users/hooks/use-user-quota.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,5 @@ export const useUserQuota = () => {
3737
setQuota(data)
3838
}, []);
3939

40-
useEffect(() => {
41-
getQuota();
42-
}, []);
43-
44-
4540
return { quota, getQuota };
4641
};

tdrive/frontend/src/app/views/client/common/disk-usage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ const DiskUsage = () => {
1616
const [usedBytes, setUsedBytes] = useState(0);
1717
const [totalBytes, setTotalBytes] = useState(0);
1818

19-
const { quota } = useUserQuota()
19+
const { quota, getQuota } = useUserQuota();
20+
21+
useEffect(() => {
22+
getQuota();
23+
}, [])
24+
2025
useEffect(() => {
2126
if (FeatureTogglesService.isActiveFeatureName(FeatureNames.COMPANY_USER_QUOTA)) {
2227
setUsed(Math.round(quota.used / quota.total * 100))

0 commit comments

Comments
 (0)