RED-5120: update pdf page on attach

This commit is contained in:
Dan Percic 2022-09-07 17:03:53 +03:00
parent bdc6688ce9
commit 2635f1aa6a

View File

@ -256,8 +256,9 @@ export class FilePreviewScreenComponent
await this.ngOnInit();
await this._fileDataService.loadRedactionLog();
this._viewerHeaderService.updateElements();
await this.#updateQueryParamsPage(Number(previousRoute.queryParams.page ?? '1'));
this._changeRef.markForCheck();
const page = previousRoute.queryParams.page ?? '1';
await this.#updateQueryParamsPage(Number(page));
await this.viewerReady(page);
}
async ngOnInit(): Promise<void> {
@ -350,8 +351,7 @@ export class FilePreviewScreenComponent
}
}
async viewerReady() {
const pageNumber: string = this._activatedRoute.snapshot.queryParams.page;
async viewerReady(pageNumber: string = this._activatedRoute.snapshot.queryParams.page) {
if (pageNumber) {
const file = this.state.file;
let page = parseInt(pageNumber, 10);