RED-3724: fix last visited page
This commit is contained in:
parent
505b6e7a93
commit
9672b0d9d6
@ -123,7 +123,7 @@ const components = [AppComponent, AuthErrorComponent, NotificationsComponent, Sp
|
||||
enabled: false,
|
||||
},
|
||||
PDF: {
|
||||
enabled: false,
|
||||
enabled: true,
|
||||
},
|
||||
STATS: {
|
||||
enabled: false,
|
||||
|
||||
@ -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();
|
||||
});
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user