Skip to content

Commit

Permalink
Hides rendering cancelled exception altogether
Browse files Browse the repository at this point in the history
  • Loading branch information
Titou325 committed Aug 22, 2024
1 parent e0d03d9 commit da051c1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib/pdf/layers/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ export const useCanvasLayer = () => {
viewport,
});

renderingTask.promise.catch((error) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (error.name === "RenderingCancelledException") {
return;
}

console.error(error);
});

return () => {
void renderingTask.cancel();
};
Expand Down

0 comments on commit da051c1

Please sign in to comment.