mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
Restore singleton pdfCachingTransportFactory (#21194)
GitOrigin-RevId: 3c1d71ba4fdd07f0774534fbe3a99b2d47dfa962
This commit is contained in:
parent
3b354462a7
commit
620f31d6a6
1 changed files with 4 additions and 1 deletions
|
@ -18,6 +18,7 @@ export default class PDFJSWrapper {
|
|||
public readonly viewer: PDFViewer
|
||||
public readonly eventBus: EventBus
|
||||
private readonly linkService: PDFLinkService
|
||||
private readonly pdfCachingTransportFactory: any
|
||||
|
||||
// eslint-disable-next-line no-useless-constructor
|
||||
constructor(public container: HTMLDivElement) {
|
||||
|
@ -43,6 +44,8 @@ export default class PDFJSWrapper {
|
|||
})
|
||||
|
||||
this.linkService.setViewer(this.viewer)
|
||||
|
||||
this.pdfCachingTransportFactory = generatePdfCachingTransportFactory()
|
||||
}
|
||||
|
||||
// load a document from a URL
|
||||
|
@ -64,7 +67,7 @@ export default class PDFJSWrapper {
|
|||
}
|
||||
|
||||
return new Promise<PDFJS.PDFDocumentProxy>((resolve, reject) => {
|
||||
const rangeTransport = generatePdfCachingTransportFactory()({
|
||||
const rangeTransport = this.pdfCachingTransportFactory({
|
||||
url,
|
||||
pdfFile,
|
||||
abortController,
|
||||
|
|
Loading…
Reference in a new issue