From d143bab32dd104995e5a220524aaef3e6e8e5d41 Mon Sep 17 00:00:00 2001 From: FlayInAHook Date: Wed, 16 Dec 2020 13:06:20 +0100 Subject: [PATCH] fixed um visibillity --- src/app/pages/profile/profile.component.html | 2 +- src/app/pages/profile/profile.component.ts | 1 + src/app/services/auth.service.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/pages/profile/profile.component.html b/src/app/pages/profile/profile.component.html index 29e627e..a1fd589 100644 --- a/src/app/pages/profile/profile.component.html +++ b/src/app/pages/profile/profile.component.html @@ -89,7 +89,7 @@ -
+
diff --git a/src/app/pages/profile/profile.component.ts b/src/app/pages/profile/profile.component.ts index ba819b1..f5c193f 100644 --- a/src/app/pages/profile/profile.component.ts +++ b/src/app/pages/profile/profile.component.ts @@ -59,6 +59,7 @@ export class ProfileComponent implements OnInit { let user : User = this.authService.getCurrentUserValue.user; user.own_password = this.password.value; user.password = this.passwordNew.value; + this.loading = true; this.userService.updateUser(user).subscribe( diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index d53810f..54adc6f 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -4,6 +4,7 @@ import { catchError, finalize, map, tap } from 'rxjs/operators'; import { environment } from '../../environments/environment'; import { Observable, BehaviorSubject, of } from 'rxjs'; import { AuthUser } from "../models/user"; +import { JsonPipe } from '@angular/common'; @Injectable({ @@ -32,6 +33,14 @@ export class AuthService { if (value === null){ value = new AuthUser(); } + if (value.user != undefined){ + let roles = []; + for (let role of value.user.roles){ + roles.push(role.name); + } + value.user.rolesString = roles.join(', '); + console.log("Getting user" + JSON.stringify(value)); + } return value; }