@@ -7,7 +7,7 @@ import { Skeleton } from 'primeng/skeleton';
77
88import { catchError , EMPTY , filter , map , of } from 'rxjs' ;
99
10- import { DatePipe , Location } from '@angular/common' ;
10+ import { DatePipe } from '@angular/common' ;
1111import { HttpErrorResponse } from '@angular/common/http' ;
1212import {
1313 ChangeDetectionStrategy ,
@@ -87,7 +87,6 @@ export class PreprintDetailsComponent implements OnInit, OnDestroy {
8787 private readonly toastService = inject ( ToastService ) ;
8888 private readonly router = inject ( Router ) ;
8989 private readonly route = inject ( ActivatedRoute ) ;
90- private readonly location = inject ( Location ) ;
9190 private readonly store = inject ( Store ) ;
9291 private readonly destroyRef = inject ( DestroyRef ) ;
9392 private readonly customDialogService = inject ( CustomDialogService ) ;
@@ -416,9 +415,10 @@ export class PreprintDetailsComponent implements OnInit, OnDestroy {
416415 const preprintIdFromUrl = urlSegments [ urlSegments . length - 1 ] ;
417416
418417 if ( preprintIdFromUrl !== newPreprintId ) {
419- const newUrl = currentUrl . replace ( / [ ^ / ] + $ / , newPreprintId ) ;
420-
421- this . location . replaceState ( newUrl ) ;
418+ this . router . navigate ( [ '../' , newPreprintId ] , {
419+ relativeTo : this . route ,
420+ replaceUrl : true ,
421+ } ) ;
422422 }
423423 }
424424}
0 commit comments