Remove the PDFPageView.error property, and simply include Errors in the "pagerendered" event instead

The way that rendering errors are handled in `PDFPageView` is *very* old, and predates e.g. the introduction of the `EventBus` by several years.
Hence we should be able to simplify things a bit here, by including the Error (when it exists) in the "pagerendered" event and thus avoid having to reach into `PDFPageView` for it.
This commit is contained in:
Jonas Jenwald 2020-09-23 14:29:21 +02:00
parent 7b15094cdf
commit 9efc1784b2
3 changed files with 12 additions and 10 deletions

View file

@ -317,7 +317,7 @@ class PDFThumbnailView {
this.renderingState = RenderingStates.RUNNING;
const renderCapability = createPromiseCapability();
const finishRenderTask = error => {
const finishRenderTask = (error = null) => {
// The renderTask may have been replaced by a new one, so only remove
// the reference to the renderTask if it matches the one that is
// triggering this callback.