mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 21:59:00 +02:00
Merge pull request #22756 from overleaf/dp-preload-pdf-presentation
Load full pdf document in background when entering presentation mode GitOrigin-RevId: 514ef838b155a7f13f3bc12690aef45fd3f2c3fc
This commit is contained in:
@@ -133,6 +133,8 @@ export default function usePresentationMode(
|
||||
pdfJsWrapper.viewer.scrollMode = 3 // page
|
||||
pdfJsWrapper.viewer.spreadMode = 0 // none
|
||||
|
||||
pdfJsWrapper.fetchAllData()
|
||||
|
||||
setPresentationMode(true)
|
||||
}
|
||||
}, [pdfJsWrapper, setScale, scale])
|
||||
|
||||
@@ -99,6 +99,10 @@ export default class PDFJSWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
async fetchAllData() {
|
||||
await this.viewer.pdfDocument?.getData()
|
||||
}
|
||||
|
||||
// update the current scale value if the container size changes
|
||||
updateOnResize() {
|
||||
if (!this.isVisible()) {
|
||||
|
||||
Reference in New Issue
Block a user