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:
David
2025-01-13 13:32:10 +00:00
committed by Copybot
parent 9eb1dbd664
commit 02ed26221e
2 changed files with 6 additions and 0 deletions
@@ -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()) {