-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added patch to fix console error in pdf destroy
- Loading branch information
1 parent
5d5af8f
commit 155b40c
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |