mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-06 13:05:32 +00:00
fix(console): username dialog response (#2888)
This commit is contained in:
parent
cf727b7fff
commit
2553bb173e
@ -69,7 +69,7 @@ export class AuthUserDetailComponent implements OnDestroy {
|
||||
}
|
||||
|
||||
public changeUsername(): void {
|
||||
const dialogRefPhone = this.dialog.open(EditDialogComponent, {
|
||||
const dialogRef = this.dialog.open(EditDialogComponent, {
|
||||
data: {
|
||||
confirmKey: 'ACTIONS.CHANGE',
|
||||
cancelKey: 'ACTIONS.CANCEL',
|
||||
@ -81,10 +81,10 @@ export class AuthUserDetailComponent implements OnDestroy {
|
||||
width: '400px',
|
||||
});
|
||||
|
||||
dialogRefPhone.afterClosed().subscribe((resp) => {
|
||||
if (resp && resp !== this.user.userName) {
|
||||
dialogRef.afterClosed().subscribe((resp: { value: string }) => {
|
||||
if (resp && resp.value && resp.value !== this.user.userName) {
|
||||
this.userService
|
||||
.updateMyUserName(resp)
|
||||
.updateMyUserName(resp.value)
|
||||
.then(() => {
|
||||
this.toast.showInfo('USER.TOAST.USERNAMECHANGED', true);
|
||||
this.refreshUser();
|
||||
|
@ -85,7 +85,7 @@ export class UserDetailComponent implements OnInit {
|
||||
}
|
||||
|
||||
public changeUsername(): void {
|
||||
const dialogRefPhone = this.dialog.open(EditDialogComponent, {
|
||||
const dialogRef = this.dialog.open(EditDialogComponent, {
|
||||
data: {
|
||||
confirmKey: 'ACTIONS.CHANGE',
|
||||
cancelKey: 'ACTIONS.CANCEL',
|
||||
@ -97,10 +97,10 @@ export class UserDetailComponent implements OnInit {
|
||||
width: '400px',
|
||||
});
|
||||
|
||||
dialogRefPhone.afterClosed().subscribe((resp) => {
|
||||
if (resp && resp !== this.user.userName) {
|
||||
dialogRef.afterClosed().subscribe((resp: { value: string }) => {
|
||||
if (resp.value && resp.value !== this.user.userName) {
|
||||
this.mgmtUserService
|
||||
.updateUserName(this.user.id, resp)
|
||||
.updateUserName(this.user.id, resp.value)
|
||||
.then(() => {
|
||||
this.toast.showInfo('USER.TOAST.USERNAMECHANGED', true);
|
||||
this.refreshUser();
|
||||
|
Loading…
x
Reference in New Issue
Block a user