Merge pull request #511 from ONLYOFFICE/bugfix/recalculate-quota
bugfix/recalculate-quota
This commit is contained in:
commit
91bdaf2ed3
@ -60,7 +60,7 @@ const StorageManagement = ({
|
||||
ready && setDocumentTitle(t("Settings:StorageManagement"));
|
||||
}, [ready]);
|
||||
|
||||
if (!isInit || !ready) return <SettingsStorageManagementSkeleton />;
|
||||
if (!ready || !isInit) return <SettingsStorageManagementSkeleton />;
|
||||
|
||||
return (
|
||||
<StyledBody>
|
||||
|
@ -102,6 +102,8 @@ class StorageManagement {
|
||||
);
|
||||
}
|
||||
|
||||
this.needRecalculating = false;
|
||||
|
||||
try {
|
||||
if (isInit) this.needRecalculating = await checkRecalculateQuota();
|
||||
|
||||
@ -123,12 +125,16 @@ class StorageManagement {
|
||||
);
|
||||
|
||||
if (!this.quotaSettings.lastRecalculateDate && isInit) {
|
||||
this.setIsRecalculating(true);
|
||||
await recalculateQuota();
|
||||
this.getIntervalCheckRecalculate();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.needRecalculating) this.getIntervalCheckRecalculate();
|
||||
if (this.needRecalculating) {
|
||||
this.setIsRecalculating(true);
|
||||
this.getIntervalCheckRecalculate();
|
||||
}
|
||||
} catch (e) {
|
||||
toastr.error(e);
|
||||
}
|
||||
@ -180,6 +186,9 @@ class StorageManagement {
|
||||
};
|
||||
getIntervalCheckRecalculate = () => {
|
||||
let isWaitRequest = false;
|
||||
|
||||
if (this.intervalId) return;
|
||||
|
||||
this.intervalId = setInterval(async () => {
|
||||
try {
|
||||
if (isWaitRequest) {
|
||||
|
Loading…
Reference in New Issue
Block a user