Skip to content

Commit

Permalink
Fix pdfjs.renderTextLayer wrapped in makeCancellable where it was alr…
Browse files Browse the repository at this point in the history
…eady cancellable

Related to #1151
  • Loading branch information
wojtekmaj committed Nov 10, 2022
1 parent 4962d3b commit a1f7eb9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Page/TextLayer.jsx
Expand Up @@ -126,16 +126,15 @@ export class TextLayerInternal extends PureComponent {
// If another rendering is in progress, let's cancel it
cancelRunningTask(this.runningTask);

this.layerElement.current.innerHTML = '';

const parameters = {
container: this.layerElement.current,
textContent,
viewport,
};

this.layerElement.current.innerHTML = '';

this.runningTask = pdfjs.renderTextLayer(parameters);
const cancellable = makeCancellable(this.runningTask.promise);
const cancellable = pdfjs.renderTextLayer(parameters);
this.runningTask = cancellable;

cancellable.promise
Expand Down

0 comments on commit a1f7eb9

Please sign in to comment.