From a5fd7df34da790377052e660e991e614a1bde27c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 19 Mar 2021 16:18:47 +0200 Subject: Fixed going to your profile (via navbar) while on someone else's profile --- src/app/components/navbar/navbar.component.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/app') diff --git a/src/app/components/navbar/navbar.component.ts b/src/app/components/navbar/navbar.component.ts index d10a49d..b62d8e0 100644 --- a/src/app/components/navbar/navbar.component.ts +++ b/src/app/components/navbar/navbar.component.ts @@ -29,6 +29,11 @@ export class NavbarComponent implements OnInit { } goToProfile(): void { + // Properly reload the page + // Needed because if you're on someone's profile and go to yours, angular won't refresh the page (with your info) + this._router.routeReuseStrategy.shouldReuseRoute = () => false; + this._router.onSameUrlNavigation = 'reload'; + this._router.navigate(['/profile/' + this.user.userName]); } -- cgit v1.2.3