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;
|
let numVisible = visibleViews.length;
|
||||||
if (numVisible === 0) {
|
if (numVisible === 0) {
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < numVisible; ++i) {
|
for (let i = 0; i < numVisible; ++i) {
|
||||||
let view = visibleViews[i].view;
|
let view = visibleViews[i].view;
|
||||||
@ -162,10 +162,9 @@ class PDFRenderingQueue {
|
|||||||
break;
|
break;
|
||||||
case RenderingStates.INITIAL:
|
case RenderingStates.INITIAL:
|
||||||
this.highestPriorityPage = view.renderingId;
|
this.highestPriorityPage = view.renderingId;
|
||||||
let continueRendering = () => {
|
view.draw().finally(() => {
|
||||||
this.renderHighestPriority();
|
this.renderHighestPriority();
|
||||||
};
|
});
|
||||||
view.draw().then(continueRendering, continueRendering);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user