PM-4978 Addressed review comments
This commit is contained in:
parent
97a069affb
commit
c27f5b7337
|
@ -11,11 +11,11 @@
|
|||
<div class="tw-col-span-6">
|
||||
<bit-form-field>
|
||||
<bit-label>{{ "name" | i18n }}</bit-label>
|
||||
<input bitInput type="text" formControlName="name" />
|
||||
<input bitInput formControlName="name" />
|
||||
</bit-form-field>
|
||||
<bit-form-field>
|
||||
<bit-label>{{ "email" | i18n }}</bit-label>
|
||||
<input bitInput type="text" formControlName="email" readonly />
|
||||
<input bitInput formControlName="email" readonly />
|
||||
</bit-form-field>
|
||||
</div>
|
||||
<div class="tw-col-span-6">
|
||||
|
|
|
@ -42,8 +42,8 @@ export class ProfileComponent implements OnInit, OnDestroy {
|
|||
this.profile = await this.apiService.getProfile();
|
||||
this.loading = false;
|
||||
this.fingerprintMaterial = await this.stateService.getUserId();
|
||||
this.name = this.profile.name;
|
||||
this.email = this.profile.email;
|
||||
this.formGroup.get("name").setValue(this.profile.name);
|
||||
this.formGroup.get("email").setValue(this.profile.email);
|
||||
|
||||
this.formGroup
|
||||
.get("name")
|
||||
|
@ -58,22 +58,6 @@ export class ProfileComponent implements OnInit, OnDestroy {
|
|||
this.destroy$.complete();
|
||||
}
|
||||
|
||||
get name(): string {
|
||||
return this.formGroup.value.name;
|
||||
}
|
||||
|
||||
set name(profileName: string) {
|
||||
this.formGroup.get("name").setValue(profileName);
|
||||
}
|
||||
|
||||
get email(): string {
|
||||
return this.formGroup.value.email;
|
||||
}
|
||||
|
||||
set email(profileEmail: string) {
|
||||
this.formGroup.get("email").setValue(profileEmail);
|
||||
}
|
||||
|
||||
openChangeAvatar = async () => {
|
||||
const modalOpened = await this.modalService.openViewRef(
|
||||
ChangeAvatarComponent,
|
||||
|
@ -88,7 +72,10 @@ export class ProfileComponent implements OnInit, OnDestroy {
|
|||
};
|
||||
|
||||
submit = async () => {
|
||||
const request = new UpdateProfileRequest(this.name, this.profile.masterPasswordHint);
|
||||
const request = new UpdateProfileRequest(
|
||||
this.formGroup.get("name").value,
|
||||
this.profile.masterPasswordHint,
|
||||
);
|
||||
await this.apiService.putProfile(request);
|
||||
this.platformUtilsService.showToast("success", null, this.i18nService.t("accountUpdated"));
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue