]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/users/user-edit/user-password.component.ts
Add message if registration is disabled
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / users / user-edit / user-password.component.ts
index 05d52b17f0679db2853deda66db76122d7a7c09a..42bf20de14a6a5745207a1aaef45e7331fc8f354 100644 (file)
@@ -20,7 +20,7 @@ export class UserPasswordComponent extends FormReactive implements OnInit {
     protected formValidatorService: FormValidatorService,
     private notifier: Notifier,
     private userService: UserService
-    ) {
+  ) {
     super()
   }
 
@@ -35,13 +35,14 @@ export class UserPasswordComponent extends FormReactive implements OnInit {
 
     const userUpdate: UserUpdate = this.form.value
 
-    this.userService.updateUser(this.userId, userUpdate).subscribe(
-      () => {
-        this.notifier.success($localize`Password changed for user ${this.username}.`)
-      },
+    this.userService.updateUser(this.userId, userUpdate)
+      .subscribe({
+        next: () => this.notifier.success($localize`Password changed for user ${this.username}.`),
 
-      err => this.error = err.message
-    )
+        error: err => {
+          this.error = err.message
+        }
+      })
   }
 
   togglePasswordVisibility () {