Merge pull request #15455 from Snuffleupagus/issue-15453

Don't update the Scroll/Spread-mode in the ViewHistory while PresentationMode is active (issue 15453)
This commit is contained in:
Tim van der Meij 2022-09-18 14:35:00 +02:00 committed by GitHub
commit 67160f4cae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2469,7 +2469,10 @@ function webViewerUpdateViewarea({ location }) {
}
function webViewerScrollModeChanged(evt) {
if (PDFViewerApplication.isInitialViewSet) {
if (
PDFViewerApplication.isInitialViewSet &&
!PDFViewerApplication.pdfViewer.isInPresentationMode
) {
// Only update the storage when the document has been loaded *and* rendered.
PDFViewerApplication.store?.set("scrollMode", evt.mode).catch(() => {
// Unable to write to storage.
@ -2478,7 +2481,10 @@ function webViewerScrollModeChanged(evt) {
}
function webViewerSpreadModeChanged(evt) {
if (PDFViewerApplication.isInitialViewSet) {
if (
PDFViewerApplication.isInitialViewSet &&
!PDFViewerApplication.pdfViewer.isInPresentationMode
) {
// Only update the storage when the document has been loaded *and* rendered.
PDFViewerApplication.store?.set("spreadMode", evt.mode).catch(() => {
// Unable to write to storage.