Merge pull request #10582 from Snuffleupagus/web-finally
Use `Promise.prototype.finally` in the `PDFRenderingQueue.renderView` method
This commit is contained in:
commit
652059056c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user