forked from lthn/blockchain
Merge remote-tracking branch 'origin/frontend'
This commit is contained in:
commit
ee59dceb25
15 changed files with 306 additions and 4172 deletions
|
|
@ -161,7 +161,9 @@
|
|||
"ADDRESS_REQUIRED": "Address is required.",
|
||||
"ADDRESS_NOT_VALID": "Address not valid.",
|
||||
"AMOUNT_REQUIRED": "Amount is required.",
|
||||
"MINIMUM_FEE": "Minimum fee: {{fee}}"
|
||||
"AMOUNT_ZERO": "Amount is zero.",
|
||||
"FEE_REQUIRED": "Fee is required.",
|
||||
"FEE_MINIMUM": "Minimum fee: {{fee}}"
|
||||
}
|
||||
},
|
||||
"HISTORY": {
|
||||
|
|
@ -220,12 +222,14 @@
|
|||
"SEND_BUTTON": "Send",
|
||||
"FORM_ERRORS": {
|
||||
"DESC_REQUIRED": "Description is required.",
|
||||
"DESC_MAXIMUM": "Maximum field length reached.",
|
||||
"SELLER_REQUIRED": "Seller is required.",
|
||||
"SELLER_NOT_VALID": "Seller not valid.",
|
||||
"AMOUNT_REQUIRED": "Amount is required.",
|
||||
"YOUR_DEPOSIT_REQUIRED": "Your deposit is required.",
|
||||
"SELLER_DEPOSIT_REQUIRED": "Seller deposit is required.",
|
||||
"SELLER_SAME": "The seller's and buyer's accounts are identical. The seller and buyer must use different wallet for the contract."
|
||||
"SELLER_SAME": "The seller's and buyer's accounts are identical. The seller and buyer must use different wallet for the contract.",
|
||||
"COMMENT_MAXIMUM": "Maximum field length reached."
|
||||
},
|
||||
"CANCEL_BUTTON": "Cancel and return deposits",
|
||||
"TERMINATE_BUTTON": "Terminate and burn deposits",
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
|
@ -30,7 +30,6 @@
|
|||
"core-js": "^2.5.4",
|
||||
"highcharts": "^6.2.0",
|
||||
"idlejs": "^2.0.1",
|
||||
"inputmask": "^4.0.4",
|
||||
"json-bignumber": "^1.0.1",
|
||||
"ngx-contextmenu": "^5.1.1",
|
||||
"qrcode": "^1.3.0",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import {Directive, ElementRef, Input} from '@angular/core';
|
||||
import * as Inputmask from 'inputmask';
|
||||
import {Directive, ElementRef, Input, HostListener} from '@angular/core';
|
||||
import {VariablesService} from '../../services/variables.service';
|
||||
|
||||
@Directive({
|
||||
|
|
@ -7,30 +6,69 @@ import {VariablesService} from '../../services/variables.service';
|
|||
})
|
||||
export class InputValidateDirective {
|
||||
|
||||
private regexMap = {
|
||||
integer: {
|
||||
regex: '^[0-9]*$',
|
||||
placeholder: ''
|
||||
},
|
||||
// float: '^[+-]?([0-9]*[.])?[0-9]+$',
|
||||
// words: '([A-z]*\\s)*',
|
||||
// point25: '^\-?[0-9]*(?:\\.25|\\.50|\\.75|)$',
|
||||
money: {
|
||||
alias: 'decimal',
|
||||
digits: this.variablesService.digits,
|
||||
max: 99999999.999999999999,
|
||||
rightAlign: false,
|
||||
allowMinus: false,
|
||||
onBeforeMask: (value) => value
|
||||
}
|
||||
};
|
||||
private type: string;
|
||||
|
||||
constructor(private el: ElementRef, private variablesService: VariablesService) {
|
||||
}
|
||||
|
||||
@Input('appInputValidate')
|
||||
public set defineInputType(type: string) {
|
||||
Inputmask(this.regexMap[type]).mask(this.el.nativeElement);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@HostListener('input', ['$event'])
|
||||
handleInput(event: Event) {
|
||||
if ( this.type === 'money' ) {
|
||||
this.moneyValidation(event);
|
||||
} else if ( this.type === 'integer' ) {
|
||||
this.integerValidation(event);
|
||||
}
|
||||
}
|
||||
|
||||
private moneyValidation(event: Event) {
|
||||
let currentValue = (<HTMLInputElement>event.target).value;
|
||||
const originalValue = currentValue;
|
||||
const OnlyD = /[^\d\.]/g;
|
||||
const _has_error = currentValue.match(OnlyD);
|
||||
if (_has_error && _has_error.length) {
|
||||
currentValue = currentValue.replace(',', '.').replace(OnlyD, '');
|
||||
}
|
||||
const _double_separator = currentValue.match(/\./g);
|
||||
if (_double_separator && _double_separator.length > 1) {
|
||||
currentValue = currentValue.substr(0, currentValue.lastIndexOf('.'));
|
||||
}
|
||||
if (currentValue.indexOf('.') === 0) {
|
||||
currentValue = '0' + currentValue;
|
||||
}
|
||||
const _zero_fill = currentValue.split('.');
|
||||
if (_zero_fill[0].length > 7) {
|
||||
_zero_fill[0] = _zero_fill[0].substr(0, 7);
|
||||
}
|
||||
|
||||
if (1 in _zero_fill && _zero_fill[1].length) {
|
||||
_zero_fill[1] = _zero_fill[1].substr(0, this.variablesService.digits);
|
||||
}
|
||||
currentValue = _zero_fill.join('.');
|
||||
if (currentValue !== originalValue) {
|
||||
const cursorPosition = (<HTMLInputElement>event.target).selectionEnd;
|
||||
(<HTMLInputElement>event.target).value = currentValue;
|
||||
(<HTMLInputElement>event.target).setSelectionRange(cursorPosition, cursorPosition);
|
||||
}
|
||||
}
|
||||
|
||||
private integerValidation(event: Event) {
|
||||
let currentValue = (<HTMLInputElement>event.target).value;
|
||||
const originalValue = currentValue;
|
||||
const OnlyD = /[^\d]/g;
|
||||
const _has_error = currentValue.match(OnlyD);
|
||||
if (_has_error && _has_error.length) {
|
||||
currentValue = currentValue.replace(OnlyD, '');
|
||||
}
|
||||
if (currentValue !== originalValue) {
|
||||
const cursorPosition = (<HTMLInputElement>event.target).selectionEnd;
|
||||
(<HTMLInputElement>event.target).value = currentValue;
|
||||
(<HTMLInputElement>event.target).setSelectionRange(cursorPosition, cursorPosition);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,14 @@ export class Wallet {
|
|||
progress?: number;
|
||||
loaded?: boolean;
|
||||
|
||||
send_data?:any = {
|
||||
address: null,
|
||||
amount: null,
|
||||
comment: null,
|
||||
mixin: null,
|
||||
fee: null
|
||||
};
|
||||
|
||||
constructor(id, name, pass, path, address, balance, unlocked_balance, mined = 0, tracking = '') {
|
||||
this.wallet_id = id;
|
||||
this.name = name;
|
||||
|
|
|
|||
|
|
@ -478,18 +478,15 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
if (typeof clipboard !== 'string' || clipboard.length) {
|
||||
const start = (target['contextSelectionStart']) ? 'contextSelectionStart' : 'selectionStart';
|
||||
const end = (target['contextSelectionEnd']) ? 'contextSelectionEnd' : 'selectionEnd';
|
||||
const canUseSelection = ((target[start]) || (target[start] === '0'));
|
||||
let _pre = '';
|
||||
let _aft = '';
|
||||
if (canUseSelection) {
|
||||
_pre = target['value'].substring(0, target[start]);
|
||||
_aft = target['value'].substring(target[end], target['value'].length);
|
||||
}
|
||||
let text = (!canUseSelection) ? clipboard : _pre + clipboard + _aft;
|
||||
const _pre = target['value'].substring(0, target[start]);
|
||||
const _aft = target['value'].substring(target[end], target['value'].length);
|
||||
let text = _pre + clipboard + _aft;
|
||||
const cursorPosition = (_pre + clipboard).length;
|
||||
if (target['maxLength'] && parseInt(target['maxLength'], 10) > 0) {
|
||||
text = text.substr(0, parseInt(target['maxLength'], 10));
|
||||
}
|
||||
target['value'] = text;
|
||||
target.setSelectionRange(cursorPosition, cursorPosition);
|
||||
target.dispatchEvent(new Event('input'));
|
||||
target['focus']();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,18 +14,23 @@
|
|||
|
||||
<div class="input-block">
|
||||
<label for="purchase-description">{{ 'PURCHASE.DESCRIPTION' | translate }}</label>
|
||||
<input type="text" id="purchase-description" formControlName="description" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<input type="text" id="purchase-description" formControlName="description" maxlength="100" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<div class="error-block" *ngIf="purchaseForm.controls['description'].invalid && (purchaseForm.controls['description'].dirty || purchaseForm.controls['description'].touched)">
|
||||
<div *ngIf="purchaseForm.controls['description'].errors['required']">
|
||||
{{ 'PURCHASE.FORM_ERRORS.DESC_REQUIRED' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="error-block" *ngIf="newPurchase && purchaseForm.controls['description'].value.length >= 100">
|
||||
<div>
|
||||
{{ 'PURCHASE.FORM_ERRORS.COMMENT_MAXIMUM' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-blocks-row">
|
||||
<div class="input-block">
|
||||
<label for="purchase-seller">{{ 'PURCHASE.SELLER' | translate }}</label>
|
||||
<input type="text" id="purchase-seller" formControlName="seller" (blur)="checkAddressValidation()" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<input type="text" id="purchase-seller" formControlName="seller" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<div class="error-block" *ngIf="purchaseForm.controls['seller'].invalid && (purchaseForm.controls['seller'].dirty || purchaseForm.controls['seller'].touched)">
|
||||
<div *ngIf="purchaseForm.controls['seller'].errors['required']">
|
||||
{{ 'PURCHASE.FORM_ERRORS.SELLER_REQUIRED' | translate }}
|
||||
|
|
@ -41,7 +46,7 @@
|
|||
|
||||
<div class="input-block">
|
||||
<label for="purchase-amount">{{ 'PURCHASE.AMOUNT' | translate }}</label>
|
||||
<input type="text" id="purchase-amount" formControlName="amount" appInputValidate="money" maxlength="20" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<input type="text" id="purchase-amount" formControlName="amount" appInputValidate="money" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<div class="error-block" *ngIf="purchaseForm.controls['amount'].invalid && (purchaseForm.controls['amount'].dirty || purchaseForm.controls['amount'].touched)">
|
||||
<div *ngIf="purchaseForm.controls['amount'].errors['required']">
|
||||
{{ 'PURCHASE.FORM_ERRORS.AMOUNT_REQUIRED' | translate }}
|
||||
|
|
@ -53,7 +58,7 @@
|
|||
<div class="input-blocks-row">
|
||||
<div class="input-block">
|
||||
<label for="purchase-your-deposit">{{ 'PURCHASE.YOUR_DEPOSIT' | translate }}</label>
|
||||
<input type="text" id="purchase-your-deposit" formControlName="yourDeposit" appInputValidate="money" maxlength="20" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<input type="text" id="purchase-your-deposit" formControlName="yourDeposit" appInputValidate="money" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<div class="error-block" *ngIf="purchaseForm.controls['yourDeposit'].invalid && (purchaseForm.controls['yourDeposit'].dirty || purchaseForm.controls['yourDeposit'].touched)">
|
||||
<div *ngIf="purchaseForm.controls['yourDeposit'].errors['required']">
|
||||
{{ 'PURCHASE.FORM_ERRORS.YOUR_DEPOSIT_REQUIRED' | translate }}
|
||||
|
|
@ -70,7 +75,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<input type="text" readonly *ngIf="purchaseForm.controls['sameAmount'].value" [value]="purchaseForm.controls['amount'].value">
|
||||
<input type="text" id="purchase-seller-deposit" *ngIf="!purchaseForm.controls['sameAmount'].value" formControlName="sellerDeposit" appInputValidate="money" maxlength="20" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<input type="text" id="purchase-seller-deposit" *ngIf="!purchaseForm.controls['sameAmount'].value" formControlName="sellerDeposit" appInputValidate="money" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<div class="error-block" *ngIf="purchaseForm.controls['sellerDeposit'].invalid && (purchaseForm.controls['sellerDeposit'].dirty || purchaseForm.controls['sellerDeposit'].touched)">
|
||||
<div *ngIf="purchaseForm.controls['sellerDeposit'].errors['required']">
|
||||
{{ 'PURCHASE.FORM_ERRORS.SELLER_DEPOSIT_REQUIRED' | translate }}
|
||||
|
|
@ -81,9 +86,16 @@
|
|||
|
||||
<div class="input-block">
|
||||
<label for="purchase-comment">{{ 'PURCHASE.COMMENT' | translate }}</label>
|
||||
<input type="text" id="purchase-comment" formControlName="comment" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<input type="text" id="purchase-comment" formControlName="comment" maxlength="100" [readonly]="!newPurchase" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<div class="error-block" *ngIf="newPurchase && purchaseForm.controls['comment'].value.length >= 100">
|
||||
<div>
|
||||
{{ 'PURCHASE.FORM_ERRORS.COMMENT_MAXIMUM' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<button type="button" class="purchase-select" (click)="toggleOptions()">
|
||||
<span>{{ 'PURCHASE.DETAILS' | translate }}</span><i class="icon arrow" [class.down]="!additionalOptions" [class.up]="additionalOptions"></i>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,25 @@ export class PurchaseComponent implements OnInit, OnDestroy {
|
|||
return {'address_same': true};
|
||||
}
|
||||
return null;
|
||||
}, (g: FormControl) => {
|
||||
if (g.value) {
|
||||
this.backend.validateAddress(g.value, (valid_status) => {
|
||||
this.ngZone.run(() => {
|
||||
if (valid_status === false) {
|
||||
g.setErrors(Object.assign({'address_not_valid': true}, g.errors) );
|
||||
} else {
|
||||
if (g.hasError('address_not_valid')) {
|
||||
delete g.errors['address_not_valid'];
|
||||
if (Object.keys(g.errors).length === 0) {
|
||||
g.setErrors(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
return (g.hasError('address_not_valid')) ? {'address_not_valid': true} : null;
|
||||
}
|
||||
return null;
|
||||
}]),
|
||||
amount: new FormControl(null, Validators.required),
|
||||
yourDeposit: new FormControl(null, Validators.required),
|
||||
|
|
@ -70,6 +89,8 @@ export class PurchaseComponent implements OnInit, OnDestroy {
|
|||
this.subRouting = this.route.params.subscribe(params => {
|
||||
if (params.hasOwnProperty('id')) {
|
||||
this.currentContract = this.variablesService.currentWallet.getContract(params['id']);
|
||||
this.purchaseForm.controls['seller'].setValidators([]);
|
||||
this.purchaseForm.updateValueAndValidity();
|
||||
this.purchaseForm.setValue({
|
||||
description: this.currentContract.private_detailes.t,
|
||||
seller: this.currentContract.private_detailes.b_addr,
|
||||
|
|
@ -170,18 +191,6 @@ export class PurchaseComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
}
|
||||
|
||||
checkAddressValidation() {
|
||||
if (this.purchaseForm.get('seller').value) {
|
||||
this.backend.validateAddress(this.purchaseForm.get('seller').value, (valid_status) => {
|
||||
if (valid_status === false) {
|
||||
this.ngZone.run(() => {
|
||||
this.purchaseForm.get('seller').setErrors({address_not_valid: true});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
createPurchase() {
|
||||
if (this.purchaseForm.valid) {
|
||||
if (this.purchaseForm.get('sameAmount').value) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div class="input-block">
|
||||
<label for="send-address">{{ 'SEND.ADDRESS' | translate }}</label>
|
||||
<input type="text" id="send-address" formControlName="address" (blur)="checkAddressValidation()" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<input type="text" id="send-address" formControlName="address" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<div class="error-block" *ngIf="sendForm.controls['address'].invalid && (sendForm.controls['address'].dirty || sendForm.controls['address'].touched)">
|
||||
<div *ngIf="sendForm.controls['address'].errors['required']">
|
||||
{{ 'SEND.FORM_ERRORS.ADDRESS_REQUIRED' | translate }}
|
||||
|
|
@ -17,14 +17,14 @@
|
|||
|
||||
<div class="input-block">
|
||||
<label for="send-amount">{{ 'SEND.AMOUNT' | translate }}</label>
|
||||
<input type="text" id="send-amount" formControlName="amount" appInputValidate="money" maxlength="20" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<input type="text" id="send-amount" formControlName="amount" appInputValidate="money" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<div class="error-block" *ngIf="sendForm.controls['amount'].invalid && (sendForm.controls['amount'].dirty || sendForm.controls['amount'].touched)">
|
||||
<div *ngIf="sendForm.controls['amount'].errors['required']">
|
||||
{{ 'SEND.FORM_ERRORS.AMOUNT_REQUIRED' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="sendForm.controls['amount'].errors['zero']">
|
||||
Amount is zero.
|
||||
<div *ngIf="sendForm.controls['amount'].errors['zero']">
|
||||
{{ 'SEND.FORM_ERRORS.AMOUNT_ZERO' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -56,10 +56,10 @@
|
|||
<input type="text" id="send-fee" formControlName="fee" appInputValidate="money" (contextmenu)="variablesService.onContextMenu($event)">
|
||||
<div class="error-block" *ngIf="sendForm.controls['fee'].invalid && (sendForm.controls['fee'].dirty || sendForm.controls['fee'].touched)">
|
||||
<div *ngIf="sendForm.controls['fee'].errors['required']">
|
||||
{{ 'SEND.FORM_ERRORS.AMOUNT_REQUIRED' | translate }}
|
||||
{{ 'SEND.FORM_ERRORS.FEE_REQUIRED' | translate }}
|
||||
</div>
|
||||
<div *ngIf="sendForm.controls['fee'].errors['less_min']">
|
||||
{{ 'SEND.FORM_ERRORS.MINIMUM_FEE' | translate : {fee: variablesService.default_fee} }}
|
||||
{{ 'SEND.FORM_ERRORS.FEE_MINIMUM' | translate : {fee: variablesService.default_fee} }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -16,14 +16,33 @@ export class SendComponent implements OnInit, OnDestroy {
|
|||
currentWalletId = null;
|
||||
parentRouting;
|
||||
sendForm = new FormGroup({
|
||||
address: new FormControl('', Validators.required),
|
||||
address: new FormControl('', [Validators.required, (g: FormControl) => {
|
||||
if (g.value) {
|
||||
this.backend.validateAddress(g.value, (valid_status) => {
|
||||
this.ngZone.run(() => {
|
||||
if (valid_status === false) {
|
||||
g.setErrors(Object.assign({'address_not_valid': true}, g.errors) );
|
||||
} else {
|
||||
if (g.hasError('address_not_valid')) {
|
||||
delete g.errors['address_not_valid'];
|
||||
if (Object.keys(g.errors).length === 0) {
|
||||
g.setErrors(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
return (g.hasError('address_not_valid')) ? {'address_not_valid': true} : null;
|
||||
}
|
||||
return null;
|
||||
}]),
|
||||
amount: new FormControl(null, [Validators.required, (g: FormControl) => {
|
||||
if (g.value === '0') {
|
||||
if (new BigNumber(g.value).eq(0)) {
|
||||
return {'zero': true};
|
||||
}
|
||||
return null;
|
||||
}]),
|
||||
comment: new FormControl(''),
|
||||
comment: new FormControl(null),
|
||||
mixin: new FormControl(0, Validators.required),
|
||||
fee: new FormControl(this.variablesService.default_fee, [Validators.required, (g: FormControl) => {
|
||||
if ((new BigNumber(g.value)).isLessThan(this.variablesService.default_fee)) {
|
||||
|
|
@ -45,20 +64,14 @@ export class SendComponent implements OnInit, OnDestroy {
|
|||
ngOnInit() {
|
||||
this.parentRouting = this.route.parent.params.subscribe(params => {
|
||||
this.currentWalletId = params['id'];
|
||||
this.sendForm.reset({address: '', amount: null, comment: '', mixin: 0, fee: this.variablesService.default_fee});
|
||||
});
|
||||
}
|
||||
|
||||
checkAddressValidation() {
|
||||
if (this.sendForm.get('address').value) {
|
||||
this.backend.validateAddress(this.sendForm.get('address').value, (valid_status) => {
|
||||
if (valid_status === false) {
|
||||
this.ngZone.run(() => {
|
||||
this.sendForm.get('address').setErrors({address_not_valid: true});
|
||||
});
|
||||
}
|
||||
this.sendForm.reset({
|
||||
address: this.variablesService.currentWallet.send_data['address'],
|
||||
amount: this.variablesService.currentWallet.send_data['amount'],
|
||||
comment: this.variablesService.currentWallet.send_data['comment'],
|
||||
mixin: this.variablesService.currentWallet.send_data['mixin'] || 0,
|
||||
fee: this.variablesService.currentWallet.send_data['fee'] || this.variablesService.default_fee
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onSend() {
|
||||
|
|
@ -79,7 +92,8 @@ export class SendComponent implements OnInit, OnDestroy {
|
|||
(send_status, send_data) => {
|
||||
if (send_status) {
|
||||
this.modalService.prepareModal('success', 'SEND.SUCCESS_SENT');
|
||||
this.sendForm.reset({address: '', amount: null, comment: '', mixin: 0, fee: this.variablesService.default_fee});
|
||||
this.variablesService.currentWallet.send_data = {address: null, amount: null, comment: null, mixin: null, fee: null};
|
||||
this.sendForm.reset({address: null, amount: null, comment: null, mixin: 0, fee: this.variablesService.default_fee});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -93,6 +107,13 @@ export class SendComponent implements OnInit, OnDestroy {
|
|||
|
||||
ngOnDestroy() {
|
||||
this.parentRouting.unsubscribe();
|
||||
this.variablesService.currentWallet.send_data = {
|
||||
address: this.sendForm.get('address').value,
|
||||
amount: this.sendForm.get('amount').value,
|
||||
comment: this.sendForm.get('comment').value,
|
||||
mixin: this.sendForm.get('mixin').value,
|
||||
fee: this.sendForm.get('fee').value
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="blue-button">{{ 'SETTINGS.MASTER_PASSWORD.BUTTON' | translate }}</button>
|
||||
<button type="submit" class="blue-button" [disabled]="!changeForm.valid">{{ 'SETTINGS.MASTER_PASSWORD.BUTTON' | translate }}</button>
|
||||
|
||||
</form>
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,9 @@
|
|||
"ADDRESS_REQUIRED": "Address is required.",
|
||||
"ADDRESS_NOT_VALID": "Address not valid.",
|
||||
"AMOUNT_REQUIRED": "Amount is required.",
|
||||
"MINIMUM_FEE": "Minimum fee: {{fee}}"
|
||||
"AMOUNT_ZERO": "Amount is zero.",
|
||||
"FEE_REQUIRED": "Fee is required.",
|
||||
"FEE_MINIMUM": "Minimum fee: {{fee}}"
|
||||
}
|
||||
},
|
||||
"HISTORY": {
|
||||
|
|
@ -220,12 +222,14 @@
|
|||
"SEND_BUTTON": "Send",
|
||||
"FORM_ERRORS": {
|
||||
"DESC_REQUIRED": "Description is required.",
|
||||
"DESC_MAXIMUM": "Maximum field length reached.",
|
||||
"SELLER_REQUIRED": "Seller is required.",
|
||||
"SELLER_NOT_VALID": "Seller not valid.",
|
||||
"AMOUNT_REQUIRED": "Amount is required.",
|
||||
"YOUR_DEPOSIT_REQUIRED": "Your deposit is required.",
|
||||
"SELLER_DEPOSIT_REQUIRED": "Seller deposit is required.",
|
||||
"SELLER_SAME": "The seller's and buyer's accounts are identical. The seller and buyer must use different wallet for the contract."
|
||||
"SELLER_SAME": "The seller's and buyer's accounts are identical. The seller and buyer must use different wallet for the contract.",
|
||||
"COMMENT_MAXIMUM": "Maximum field length reached."
|
||||
},
|
||||
"CANCEL_BUTTON": "Cancel and return deposits",
|
||||
"TERMINATE_BUTTON": "Terminate and burn deposits",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue