From 7bb7b5c39a271cea38d4b34c81c21c1de26ac310 Mon Sep 17 00:00:00 2001 From: Stedoss <29103029+Stedoss@users.noreply.github.com> Date: Fri, 5 Jul 2024 00:48:57 +0100 Subject: [PATCH] Replace `username` with `userId` in `view-user` location state --- nise-frontend/src/app/view-user/view-user.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nise-frontend/src/app/view-user/view-user.component.ts b/nise-frontend/src/app/view-user/view-user.component.ts index 4ef05d4..1d3a964 100644 --- a/nise-frontend/src/app/view-user/view-user.component.ts +++ b/nise-frontend/src/app/view-user/view-user.component.ts @@ -3,7 +3,7 @@ import {SimilarReplay, SuspiciousScore} from "../replays"; import { HttpClient } from "@angular/common/http"; import {catchError, EMPTY, finalize, Observable, Subscription} from "rxjs"; import {environment} from "../../environments/environment"; -import {DatePipe, DecimalPipe, JsonPipe, NgForOf, NgIf, NgOptimizedImage} from "@angular/common"; +import {DatePipe, DecimalPipe, JsonPipe, Location, NgForOf, NgIf, NgOptimizedImage} from "@angular/common"; import {ActivatedRoute, RouterLink} from "@angular/router"; import {UserDetails, UserQueueDetails} from "../userDetails"; import {calculateTimeAgo, countryCodeToFlag, formatDuration} from "../format"; @@ -68,6 +68,7 @@ export class ViewUserComponent implements OnInit, OnChanges, OnDestroy { private activatedRoute: ActivatedRoute, private title: Title, private rxStompService: RxStompService, + private location: Location, public userService: UserService, public followService: FollowService ) { } @@ -135,6 +136,8 @@ export class ViewUserComponent implements OnInit, OnChanges, OnDestroy { this.subscribeToUser(); } this.checkIfUserIsFollowed(); + + this.location.replaceState(`u/${this.userInfo.user_details.user_id}`); } ); }