RED-3724: fix last visited page

This commit is contained in:
Dan Percic 2022-04-07 12:28:52 +03:00
parent 505b6e7a93
commit 9672b0d9d6
3 changed files with 4 additions and 3 deletions

View File

@ -123,7 +123,7 @@ const components = [AppComponent, AuthErrorComponent, NotificationsComponent, Sp
enabled: false,
},
PDF: {
enabled: false,
enabled: true,
},
STATS: {
enabled: false,

View File

@ -564,8 +564,6 @@ export class PdfViewerComponent extends AutoUnsubscribe implements OnInit, OnCha
private _setReadyAndInitialState() {
this._ngZone.run(() => {
this.pdfViewer.emitDocumentLoaded();
const routePageNumber: number = this._activatedRoute.snapshot.queryParams.page;
this.pageChanged.emit(routePageNumber || 1);
this._setInitialDisplayMode();
this._tooltipsService.updateTooltipsVisibility();
});

View File

@ -327,6 +327,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
await this.#updateQueryParamsPage(page);
}
@Debounce(100)
viewerReady() {
this.ready = true;
this._setExcludedPageStyles();
@ -341,12 +342,14 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
setTimeout(async () => {
const file = await this.state.file;
let page = parseInt(pageNumber, 10);
if (page < 1 || Number.isNaN(page)) {
page = 1;
await this.#updateQueryParamsPage(page);
} else if (page > file.numberOfPages) {
page = file.numberOfPages;
}
this.selectPage(page);
this._scrollViews();
this._changeDetectorRef.markForCheck();