Skip to content

Commit

Permalink
Ignore pdfjs "page rendering canceled" errors, even in minified deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
edemaine committed Dec 20, 2023
1 parent 8318650 commit 348310a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/MessagePDF.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ WrappedMessagePDF = React.memo ({file}) ->
)
.catch (error) ->
## Ignore pdfjs's error when rendering gets canceled from page flipping
throw error unless error.name == 'RenderingCancelledException'
console.log error.message.startsWith 'Rendering cancelled, page'
throw error unless error.name == 'RenderingCancelledException' or error.message.startsWith 'Rendering cancelled, page'
-> renderTask.cancel()
, [page, elementWidth, fit, inView]

Expand Down

0 comments on commit 348310a

Please sign in to comment.