Correct timer-func

This commit is contained in:
Andrey Shimagin 2022-03-30 17:34:52 +03:00
parent 9a492900ab
commit 2b5a7a0c6f

View file

@ -668,6 +668,8 @@ class MainController extends Component {
}); });
this.api.asc_registerCallback("asc_onDocInfo", (obj) => { this.api.asc_registerCallback("asc_onDocInfo", (obj) => {
clearTimeout(this.timerLoading);
this.objectInfo = obj; this.objectInfo = obj;
if(!this.timerDocInfo) { if(!this.timerDocInfo) {
this.timerDocInfo = setInterval(() => { this.timerDocInfo = setInterval(() => {
@ -675,14 +677,12 @@ class MainController extends Component {
}, 300); }, 300);
storeDocumentInfo.changeCount(this.objectInfo); storeDocumentInfo.changeCount(this.objectInfo);
} }
clearTimeout(this.timerLoading);
}); });
this.api.asc_registerCallback('asc_onGetDocInfoEnd', () => { this.api.asc_registerCallback('asc_onGetDocInfoEnd', () => {
storeDocumentInfo.switchIsLoaded(true);
clearTimeout(this.timerLoading); clearTimeout(this.timerLoading);
clearInterval(this.timerDocInfo); clearInterval(this.timerDocInfo);
storeDocumentInfo.switchIsLoaded(true);
}); });
// Color Schemes // Color Schemes