diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index ed6c86184..2a9150234 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -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 { @@ -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);