Merge pull request #10582 from Snuffleupagus/web-finally

Use `Promise.prototype.finally` in the `PDFRenderingQueue.renderView` method
This commit is contained in:
Tim van der Meij 2019-02-25 23:58:47 +01:00 committed by GitHub
commit 652059056c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,7 +107,7 @@ class PDFRenderingQueue {
let numVisible = visibleViews.length;
if (numVisible === 0) {
return false;
return null;
}
for (let i = 0; i < numVisible; ++i) {
let view = visibleViews[i].view;
@ -162,10 +162,9 @@ class PDFRenderingQueue {
break;
case RenderingStates.INITIAL:
this.highestPriorityPage = view.renderingId;
let continueRendering = () => {
view.draw().finally(() => {
this.renderHighestPriority();
};
view.draw().then(continueRendering, continueRendering);
});
break;
}
return true;