Merge pull request #8291 from Snuffleupagus/pr-8157
Ensure that `PDFThumbnailView.draw` is able to handle `RenderingCancelledException` correctly (PR 8157 follow-up)
This commit is contained in:
commit
c6e8ca863e
@ -14,6 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { getOutputScale, mozL10n } from './ui_utils';
|
import { getOutputScale, mozL10n } from './ui_utils';
|
||||||
|
import { RenderingCancelledException } from './pdfjs';
|
||||||
import { RenderingStates } from './pdf_rendering_queue';
|
import { RenderingStates } from './pdf_rendering_queue';
|
||||||
|
|
||||||
var THUMBNAIL_WIDTH = 98; // px
|
var THUMBNAIL_WIDTH = 98; // px
|
||||||
@ -288,8 +289,11 @@ var PDFThumbnailView = (function PDFThumbnailViewClosure() {
|
|||||||
if (renderTask === self.renderTask) {
|
if (renderTask === self.renderTask) {
|
||||||
self.renderTask = null;
|
self.renderTask = null;
|
||||||
}
|
}
|
||||||
if (error === 'cancelled') {
|
|
||||||
rejectRenderPromise(error);
|
if (((typeof PDFJSDev === 'undefined' ||
|
||||||
|
!PDFJSDev.test('PDFJS_NEXT')) && error === 'cancelled') ||
|
||||||
|
error instanceof RenderingCancelledException) {
|
||||||
|
resolveRenderPromise(undefined);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user