1
0
Fork 0
forked from lthn/blockchain

Merge branch 'frontend'

This commit is contained in:
wildkif 2019-05-07 19:04:09 +03:00
commit 344f7ee180
9 changed files with 26 additions and 22 deletions

View file

@ -513,7 +513,7 @@
"MINED": "Mined",
"LOCKED": "Blocked",
"IS_MINIMIZE": "Zano application is minimized to the system tray",
"RESTORE": "You can recover it by double-clicking or using the context menu",
"RESTORE": "You can recover it by clicking or using the context menu",
"TRAY_MENU_SHOW": "Resize",
"TRAY_MENU_MINIMIZE": "Minimize"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
import {Component, NgZone, OnInit, OnDestroy} from '@angular/core';
import {FormGroup, FormControl, Validators} from '@angular/forms';
import {FormGroup, FormControl} from '@angular/forms';
import {ActivatedRoute, Router} from '@angular/router';
import {BackendService} from '../_helpers/services/backend.service';
import {VariablesService} from '../_helpers/services/variables.service';

View file

@ -1,5 +1,5 @@
import {Component, NgZone, OnInit} from '@angular/core';
import {Location} from "@angular/common";
import {Location} from '@angular/common';
import {BackendService} from '../_helpers/services/backend.service';
import {VariablesService} from '../_helpers/services/variables.service';
import {Router} from '@angular/router';
@ -19,9 +19,11 @@ export class MainComponent implements OnInit {
private variablesService: VariablesService,
private ngZone: NgZone,
private translate: TranslateService
) {}
) {
}
ngOnInit() {}
ngOnInit() {
}
openWallet() {
this.backend.openFileDialog(this.translate.instant('MAIN.CHOOSE_PATH'), '*', this.variablesService.settings.default_path, (file_status, file_data) => {
@ -41,7 +43,7 @@ export class MainComponent implements OnInit {
}
back() {
this.location.back()
this.location.back();
}
}

View file

@ -79,7 +79,7 @@ export class OpenWalletComponent implements OnInit, OnDestroy {
if (exists) {
this.modalService.prepareModal('error', 'OPEN_WALLET.WITH_ADDRESS_ALREADY_OPEN');
this.backend.closeWallet(open_data.wallet_id, (close_status, close_data) => {
this.backend.closeWallet(open_data.wallet_id, () => {
this.ngZone.run(() => {
this.router.navigate(['/']);
});

View file

@ -246,7 +246,7 @@
</div>
</div>
<div class="time-cancel-block-row" *ngIf="'showTimeSelect && !newPurchase && currentContract.is_a && (currentContract.state == 201 || currentContract.state == 2 || currentContract.state == 120 || currentContract.state == 130)'">
<div class="time-cancel-block-row" *ngIf="showTimeSelect && !newPurchase && currentContract.is_a && (currentContract.state == 201 || currentContract.state == 2 || currentContract.state == 120 || currentContract.state == 130)">
<div class="time-cancel-block-question">{{ 'PURCHASE.WAITING_TIME_QUESTION' | translate }}</div>
<div class="input-block">
<ng-select id="purchase-timeCancel" class="lock-selection-select"

View file

@ -6,7 +6,6 @@ import {VariablesService} from '../_helpers/services/variables.service';
import {ModalService} from '../_helpers/services/modal.service';
import {Location} from '@angular/common';
import {IntToMoneyPipe} from '../_helpers/pipes/int-to-money.pipe';
import {TranslateService} from '@ngx-translate/core';
import {BigNumber} from 'bignumber.js';
@Component({
@ -60,9 +59,12 @@ export class PurchaseComponent implements OnInit, OnDestroy {
if (!(/^@?[a-z0-9\.\-]{6,25}$/.test(g.value))) {
g.setErrors(Object.assign({'alias_not_valid': true}, g.errors));
} else {
this.backend.getAliasByName(g.value.replace('@', ''), (alias_status) => {
this.backend.getAliasByName(g.value.replace('@', ''), (alias_status, alias_data) => {
this.ngZone.run(() => {
if (alias_status) {
if (alias_data.address === this.variablesService.currentWallet.address) {
g.setErrors(Object.assign({'address_same': true}, g.errors));
}
if (g.hasError('alias_not_valid')) {
delete g.errors['alias_not_valid'];
if (Object.keys(g.errors).length === 0) {
@ -107,7 +109,8 @@ export class PurchaseComponent implements OnInit, OnDestroy {
private ngZone: NgZone,
private location: Location,
private intToMoneyPipe: IntToMoneyPipe
) {}
) {
}
checkAndChangeHistory() {
if (this.currentContract.state === 201) {
@ -166,7 +169,6 @@ export class PurchaseComponent implements OnInit, OnDestroy {
if (this.currentContract.state === 130 && this.currentContract.cancel_expiration_time !== 0 && this.currentContract.cancel_expiration_time < this.variablesService.exp_med_ts) {
this.currentContract.state = 2;
}
this.variablesService.settings.viewedContracts = (this.variablesService.settings.viewedContracts) ? this.variablesService.settings.viewedContracts : [];
let findViewedCont = false;
for (let j = 0; j < this.variablesService.settings.viewedContracts.length; j++) {
@ -184,13 +186,11 @@ export class PurchaseComponent implements OnInit, OnDestroy {
});
}
this.currentContract.is_new = false;
setTimeout(() => {
this.variablesService.currentWallet.recountNewContracts();
}, 0);
}
this.checkAndChangeHistory();
} else {
this.newPurchase = true;
}
@ -205,7 +205,6 @@ export class PurchaseComponent implements OnInit, OnDestroy {
this.currentContract.is_new = true;
this.variablesService.currentWallet.recountNewContracts();
}
});
}
@ -381,7 +380,6 @@ export class PurchaseComponent implements OnInit, OnDestroy {
this.currentContract.is_new = true;
this.currentContract.state = 130;
this.currentContract.time = this.currentContract.cancel_expiration_time;
this.variablesService.currentWallet.recountNewContracts();
this.modalService.prepareModal('info', 'PURCHASE.IGNORED_CANCEL');
this.back();

View file

@ -513,7 +513,7 @@
"MINED": "Mined",
"LOCKED": "Blocked",
"IS_MINIMIZE": "Zano application is minimized to the system tray",
"RESTORE": "You can recover it by double-clicking or using the context menu",
"RESTORE": "You can recover it by clicking or using the context menu",
"TRAY_MENU_SHOW": "Resize",
"TRAY_MENU_MINIMIZE": "Minimize"
}