mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Only handle RenderingCancelledException
in the viewer code, when rendering is cancelled
This commit is contained in:
parent
3d79bd5e87
commit
43134d5b33
2 changed files with 4 additions and 13 deletions
|
@ -407,9 +407,7 @@ class PDFPageView {
|
|||
this.paintTask = null;
|
||||
}
|
||||
|
||||
if (((typeof PDFJSDev === 'undefined' ||
|
||||
!PDFJSDev.test('PDFJS_NEXT')) && error === 'cancelled') ||
|
||||
error instanceof RenderingCancelledException) {
|
||||
if (error instanceof RenderingCancelledException) {
|
||||
this.error = null;
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
@ -589,13 +587,8 @@ class PDFPageView {
|
|||
let cancelled = false;
|
||||
let ensureNotCancelled = () => {
|
||||
if (cancelled) {
|
||||
if ((typeof PDFJSDev !== 'undefined' &&
|
||||
PDFJSDev.test('PDFJS_NEXT')) || PDFJS.pdfjsNext) {
|
||||
throw new RenderingCancelledException(
|
||||
'Rendering cancelled, page ' + this.id, 'svg');
|
||||
} else {
|
||||
throw 'cancelled'; // eslint-disable-line no-throw-literal
|
||||
}
|
||||
throw new RenderingCancelledException(
|
||||
'Rendering cancelled, page ' + this.id, 'svg');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -303,9 +303,7 @@ class PDFThumbnailView {
|
|||
this.renderTask = null;
|
||||
}
|
||||
|
||||
if (((typeof PDFJSDev === 'undefined' ||
|
||||
!PDFJSDev.test('PDFJS_NEXT')) && error === 'cancelled') ||
|
||||
error instanceof RenderingCancelledException) {
|
||||
if (error instanceof RenderingCancelledException) {
|
||||
renderCapability.resolve(undefined);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue