Fix loading doc-info for large pdf (show download progress)
This commit is contained in:
parent
730da9f345
commit
9a492900ab
|
@ -658,7 +658,9 @@ class MainController extends Component {
|
|||
const storeDocumentInfo = this.props.storeDocumentInfo;
|
||||
|
||||
this.api.asc_registerCallback("asc_onGetDocInfoStart", () => {
|
||||
this.timerLoading = setTimeout(() => {
|
||||
storeDocumentInfo.switchIsLoaded(false);
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
this.api.asc_registerCallback("asc_onGetDocInfoStop", () => {
|
||||
|
@ -666,11 +668,21 @@ class MainController extends Component {
|
|||
});
|
||||
|
||||
this.api.asc_registerCallback("asc_onDocInfo", (obj) => {
|
||||
storeDocumentInfo.changeCount(obj);
|
||||
this.objectInfo = obj;
|
||||
if(!this.timerDocInfo) {
|
||||
this.timerDocInfo = setInterval(() => {
|
||||
storeDocumentInfo.changeCount(this.objectInfo);
|
||||
}, 300);
|
||||
storeDocumentInfo.changeCount(this.objectInfo);
|
||||
}
|
||||
|
||||
clearTimeout(this.timerLoading);
|
||||
});
|
||||
|
||||
this.api.asc_registerCallback('asc_onGetDocInfoEnd', () => {
|
||||
storeDocumentInfo.switchIsLoaded(true);
|
||||
clearTimeout(this.timerLoading);
|
||||
clearInterval(this.timerDocInfo);
|
||||
});
|
||||
|
||||
// Color Schemes
|
||||
|
|
|
@ -20,7 +20,7 @@ export class storeDocumentInfo {
|
|||
symbolsWSCount: 0,
|
||||
};
|
||||
|
||||
isLoaded = false;
|
||||
isLoaded = true;
|
||||
dataDoc;
|
||||
|
||||
switchIsLoaded(value) {
|
||||
|
|
Loading…
Reference in a new issue