diff --git a/projects/common/src/lib/login/login.component.html b/projects/common/src/lib/login/login.component.html index 638ac765..da11d2f9 100644 --- a/projects/common/src/lib/login/login.component.html +++ b/projects/common/src/lib/login/login.component.html @@ -25,7 +25,7 @@
-

{{ authUser.username }}

+

{{ authUser.username }}

{{ authUser.csgoDetails?.realName || authUser.sc2Details?.battleNetBattleTag }}

diff --git a/projects/common/src/lib/login/login.component.ts b/projects/common/src/lib/login/login.component.ts index 65952a19..074ccfd3 100644 --- a/projects/common/src/lib/login/login.component.ts +++ b/projects/common/src/lib/login/login.component.ts @@ -65,11 +65,19 @@ export class LoginComponent { this.userProfile.close(); } - public navigateToProfile(id: string) { + public navigateToProfile(user: ApplicationUser) { if (window.location.href.startsWith(environment.bellumgens)) { - this.router.navigate(['/players/', id]); + if (user.csgoDetails) { + this.router.navigate(['/players/', user.csgoDetails.customUrl]); + } else if (user.sc2Details) { + this.router.navigate(['/players/', user.sc2Details.battleNetId]); + } } else { - window.location.href = `${environment.bellumgens}/players/${id}`; + if (user.csgoDetails) { + window.location.href = `${environment.bellumgens}/players/${user.csgoDetails.customUrl}`; + } else if (user.sc2Details) { + window.location.href = `${environment.bellumgens}/players/${user.sc2Details.battleNetId}`; + } } } }