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 && setDocumentTitle(t("Settings:StorageManagement"));
|
||||||
}, [ready]);
|
}, [ready]);
|
||||||
|
|
||||||
if (!isInit || !ready) return <SettingsStorageManagementSkeleton />;
|
if (!ready || !isInit) return <SettingsStorageManagementSkeleton />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledBody>
|
<StyledBody>
|
||||||
|
@ -102,6 +102,8 @@ class StorageManagement {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.needRecalculating = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (isInit) this.needRecalculating = await checkRecalculateQuota();
|
if (isInit) this.needRecalculating = await checkRecalculateQuota();
|
||||||
|
|
||||||
@ -123,12 +125,16 @@ class StorageManagement {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!this.quotaSettings.lastRecalculateDate && isInit) {
|
if (!this.quotaSettings.lastRecalculateDate && isInit) {
|
||||||
|
this.setIsRecalculating(true);
|
||||||
await recalculateQuota();
|
await recalculateQuota();
|
||||||
this.getIntervalCheckRecalculate();
|
this.getIntervalCheckRecalculate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.needRecalculating) this.getIntervalCheckRecalculate();
|
if (this.needRecalculating) {
|
||||||
|
this.setIsRecalculating(true);
|
||||||
|
this.getIntervalCheckRecalculate();
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
toastr.error(e);
|
toastr.error(e);
|
||||||
}
|
}
|
||||||
@ -180,6 +186,9 @@ class StorageManagement {
|
|||||||
};
|
};
|
||||||
getIntervalCheckRecalculate = () => {
|
getIntervalCheckRecalculate = () => {
|
||||||
let isWaitRequest = false;
|
let isWaitRequest = false;
|
||||||
|
|
||||||
|
if (this.intervalId) return;
|
||||||
|
|
||||||
this.intervalId = setInterval(async () => {
|
this.intervalId = setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
if (isWaitRequest) {
|
if (isWaitRequest) {
|
||||||
|
Loading…
Reference in New Issue
Block a user