diff --git a/Client/src/app/app.component.ts b/Client/src/app/app.component.ts index 7f18856..d81d6f1 100644 --- a/Client/src/app/app.component.ts +++ b/Client/src/app/app.component.ts @@ -28,6 +28,7 @@ export class AppComponent implements OnInit { if (user) { this.authService.currentUser = user; + this.authService.changeProfilePhoto(user.photoUrl); } } diff --git a/Client/src/app/components/members/member-edit/member-edit.component.html b/Client/src/app/components/members/member-edit/member-edit.component.html index 4da69c7..6ab1126 100644 --- a/Client/src/app/components/members/member-edit/member-edit.component.html +++ b/Client/src/app/components/members/member-edit/member-edit.component.html @@ -12,7 +12,7 @@

Your Profile

- {{user.knownAs}} + {{user.knownAs}}
Location: diff --git a/Client/src/app/components/members/member-edit/member-edit.component.ts b/Client/src/app/components/members/member-edit/member-edit.component.ts index d0bead1..10770fa 100644 --- a/Client/src/app/components/members/member-edit/member-edit.component.ts +++ b/Client/src/app/components/members/member-edit/member-edit.component.ts @@ -21,6 +21,7 @@ export class MemberEditComponent implements OnInit { } user: User; + photoUrl: string; constructor( private route: ActivatedRoute, @@ -33,6 +34,8 @@ export class MemberEditComponent implements OnInit { this.route.data.subscribe(data => { this.user = data['user']; }); + + this.authService.currentPhotoUrl.subscribe(photoUrl => this.photoUrl = photoUrl); } updateUser() { diff --git a/Client/src/app/components/members/photo-editor/photo-editor.component.ts b/Client/src/app/components/members/photo-editor/photo-editor.component.ts index 3293753..bd518fc 100644 --- a/Client/src/app/components/members/photo-editor/photo-editor.component.ts +++ b/Client/src/app/components/members/photo-editor/photo-editor.component.ts @@ -66,8 +66,9 @@ export class PhotoEditorComponent implements OnInit { this.currentMainPhoto = this.photos.filter(p => p.isMain)[0]; this.currentMainPhoto.isMain = false; photo.isMain = true; - this.getMemberPhotoChange.emit(photo.url); - + this.authService.changeProfilePhoto(photo.url); + this.authService.currentUser.photoUrl = photo.url; + localStorage.setItem('user', JSON.stringify(this.authService.currentUser)) }, error => { this.alertify.error(error); }) diff --git a/Client/src/app/components/nav-menu/nav-menu.component.html b/Client/src/app/components/nav-menu/nav-menu.component.html index c89a34b..17de2d1 100644 --- a/Client/src/app/components/nav-menu/nav-menu.component.html +++ b/Client/src/app/components/nav-menu/nav-menu.component.html @@ -16,7 +16,7 @@