aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app/components/profile-settings/profile-settings.component.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/app/components/profile-settings/profile-settings.component.ts b/src/app/components/profile-settings/profile-settings.component.ts
index b856bef..b314a9a 100644
--- a/src/app/components/profile-settings/profile-settings.component.ts
+++ b/src/app/components/profile-settings/profile-settings.component.ts
@@ -200,6 +200,12 @@ export class ProfileSettingsComponent implements OnInit {
this._userService.putUserFromSessionStorageRequest(this.updateUserFormGroup, this.user.roles, this.user.friends).subscribe({
next: () => {
this._successBar.showMsg('Profile updated successfully!');
+
+ // "Reload" page when changing username
+ const newUsername = this.updateUserFormGroup.get('username')?.value;
+ if (newUsername !== this._urlUsername) {
+ this._router.navigate(['/profile/' + newUsername + '/settings']);
+ }
},
error: (err: HttpErrorResponse) => {
this._errorBar.showError(err);