Correct saving of viewing key
This commit is contained in:
parent
fb5c76fa03
commit
70e1b6e42c
4 changed files with 47 additions and 49 deletions
|
@ -51,9 +51,10 @@ img.icon{
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttons-class {
|
.buttons-class {
|
||||||
|
font-family: 'Spartan', sans-serif;
|
||||||
background-color: #ff4722;
|
background-color: #ff4722;
|
||||||
color: white;
|
color: white;
|
||||||
font-weight: 700;
|
font-weight: 500;
|
||||||
height: 25px !important;
|
height: 25px !important;
|
||||||
width: 80px !important;
|
width: 80px !important;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -64,7 +65,8 @@ img.icon{
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-cancel-class {
|
.button-cancel-class {
|
||||||
font-weight: 700;
|
font-family: 'Spartan', sans-serif;
|
||||||
|
font-weight: 500;
|
||||||
height: 25px !important;
|
height: 25px !important;
|
||||||
width: 80px !important;
|
width: 80px !important;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
* {
|
* {
|
||||||
font-family: Spartan;
|
font-family: 'Spartan', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-title {
|
.settings-title {
|
||||||
font-family: Spartan;
|
font-family: 'Spartan', sans-serif;
|
||||||
background: #ff4722;
|
background: #ff4722;
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
|
@ -13,6 +13,9 @@
|
||||||
|
|
||||||
.settings_field {
|
.settings_field {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: Spartan;
|
font-family: 'Spartan', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mat-slide-toggle-content {
|
||||||
|
font-family: 'Spartan', sans-serif;
|
||||||
|
}
|
||||||
|
|
|
@ -23,9 +23,7 @@
|
||||||
(change)="onChange($event)">
|
(change)="onChange($event)">
|
||||||
Use zatoshis?
|
Use zatoshis?
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
|
<mat-slide-toggle formControlName="useVKey"
|
||||||
<pre></pre>
|
|
||||||
<mat-slide-toggle formControlName="VkeyOn"
|
|
||||||
(change)="onChangeVKeyOn($event)">
|
(change)="onChangeVKeyOn($event)">
|
||||||
Activate payment confirmation?
|
Activate payment confirmation?
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
|
@ -33,8 +31,7 @@
|
||||||
<mat-form-field [style.width.%]="100">
|
<mat-form-field [style.width.%]="100">
|
||||||
<mat-label>Viewing key</mat-label>
|
<mat-label>Viewing key</mat-label>
|
||||||
<input matInput placeholder="Your wallet viewing key"
|
<input matInput placeholder="Your wallet viewing key"
|
||||||
formControlName="VKey"
|
formControlName="vKey">
|
||||||
[formControl]="viewkeyControl">
|
|
||||||
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,6 @@ export class SettingsComponent implements OnInit {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
viewkeyControl = new FormControl({ value: null, disabled: true });
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private fb: UntypedFormBuilder,
|
private fb: UntypedFormBuilder,
|
||||||
private dialogRef: MatDialogRef<SettingsComponent>,
|
private dialogRef: MatDialogRef<SettingsComponent>,
|
||||||
|
@ -48,11 +46,12 @@ export class SettingsComponent implements OnInit {
|
||||||
name: [data.name, Validators.required],
|
name: [data.name, Validators.required],
|
||||||
currency: [data.currency, Validators.required],
|
currency: [data.currency, Validators.required],
|
||||||
useZats: [data.zats, Validators.required],
|
useZats: [data.zats, Validators.required],
|
||||||
VkeyOn: [data.payconf, Validators.required],
|
useVKey: [data.payconf, Validators.required],
|
||||||
VKey: [{value:data.viewkey, disabled: true },
|
vKey: [data.viewkey]
|
||||||
Validators.required
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
if (data.payconf) {
|
||||||
|
this.settingsForm.get('vKey')!.enable();
|
||||||
|
}
|
||||||
this.owner = data;
|
this.owner = data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -65,15 +64,12 @@ export class SettingsComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
|
console.log('Settings', this.settingsForm.value.vKey);
|
||||||
this.owner.name = this.settingsForm.value.name;
|
this.owner.name = this.settingsForm.value.name;
|
||||||
this.owner.currency = this.settingsForm.value.currency;
|
this.owner.currency = this.settingsForm.value.currency;
|
||||||
this.owner.zats = this.settingsForm.value.useZats;
|
this.owner.zats = this.settingsForm.value.useZats;
|
||||||
this.owner.payconf = this.useVKey;
|
this.owner.payconf = this.settingsForm.value.useVKey;
|
||||||
if ( this.settingsForm.value.VkeyOn ) {
|
this.owner.viewkey = this.settingsForm.value.vKey;
|
||||||
this.owner.viewkey = this.settingsForm.value.VKey;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
this.owner.viewkey = '';
|
|
||||||
this.dialogRef.close(this.owner);
|
this.dialogRef.close(this.owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,9 +84,9 @@ export class SettingsComponent implements OnInit {
|
||||||
this.useVKey = ob.checked;
|
this.useVKey = ob.checked;
|
||||||
|
|
||||||
if ( ob.checked )
|
if ( ob.checked )
|
||||||
this.viewkeyControl.enable()
|
this.settingsForm.get('vKey')!.enable();
|
||||||
else
|
else
|
||||||
this.viewkeyControl.disable();
|
this.settingsForm.get('vKey')!.disable();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue