Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added patch to fix console error in pdf destroy #31489

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions patches/react-pdf+6.2.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/node_modules/react-pdf/dist/esm/Document.js b/node_modules/react-pdf/dist/esm/Document.js
index 91db4d4..82cafec 100644
--- a/node_modules/react-pdf/dist/esm/Document.js
+++ b/node_modules/react-pdf/dist/esm/Document.js
@@ -78,7 +78,10 @@ var Document = /*#__PURE__*/function (_PureComponent) {
cancelRunningTask(_this.runningTask);

// If another loading is in progress, let's destroy it
- if (_this.loadingTask) _this.loadingTask.destroy();
+ if (_this.loadingTask) {
+ _this.loadingTask._worker.destroy();
+ _this.loadingTask.destroy();
+ };
var cancellable = makeCancellable(_this.findDocumentSource());
_this.runningTask = cancellable;
cancellable.promise.then(function (source) {
@@ -251,7 +254,10 @@ var Document = /*#__PURE__*/function (_PureComponent) {
cancelRunningTask(this.runningTask);

// If loading is in progress, let's destroy it
- if (this.loadingTask) this.loadingTask.destroy();
+ if (this.loadingTask) {
+ this.loadingTask._worker.destroy();
+ this.loadingTask.destroy();
+ };
}
}, {
key: "childContext",
Loading