diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts index 79d3bfdc1..82a03ddf3 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts @@ -428,6 +428,14 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { if (typeof $event === 'number') { this._scrollViews(); this.shouldDeselectAnnotationsOnPageChange = true; + + // Add current page in URL query params + this._router.navigate([], { + queryParams: { + page: $event + }, + queryParamsHandling: 'merge' + }); this._changeDetectorRef.detectChanges(); } } @@ -439,6 +447,12 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { if (!this.fileData.redactedFileData) { this._fileDownloadService.loadRedactedView(this.fileData); } + + // Go to initial page from query params + const pageNumber = this._activatedRoute.snapshot.queryParams.page; + if (pageNumber) { + this.selectPage(parseInt(pageNumber, 10)); + } } filtersChanged(filters: FilterModel[]) {