Skip to content

Commit

Permalink
Merge pull request #232 from bascoder/patch-1
Browse files Browse the repository at this point in the history
Don't overwrite PDFJS.workerSrc if already set
  • Loading branch information
VadimDez authored Dec 27, 2017
2 parents 1c84b8d + 742d203 commit 3bf8b21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pdf-viewer/pdf-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export class PdfViewerComponent implements OnChanges, OnInit {
@Output('on-progress') onProgress = new EventEmitter<PDFProgressData>();

constructor(private element: ElementRef) {
if (!isSSR()) {
if (!isSSR() && typeof PDFJS.workerSrc !== 'string') {
PDFJS.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${ (PDFJS as any).version }/pdf.worker.min.js`;
}
}
Expand Down

0 comments on commit 3bf8b21

Please sign in to comment.