Commit b53d83de authored by dev0tion's avatar dev0tion

Add back button to recover and create process

parent 67ea0921
......@@ -28,4 +28,7 @@
<div>
<label>{{responseMessage}}</label>
</div>
<div class="form-group">
<button type="button" class="btn btn-success" (click)="onBackClicked()">Back</button>
</div>
</div>
import { Component, Injectable } from '@angular/core';
import { FormGroup, FormControl, Validators, FormBuilder } from '@angular/forms';
import { Router } from '@angular/router';
import { GlobalService } from '../../shared/services/global.service';
import { ApiService } from '../../shared/services/api.service';
......@@ -14,7 +15,7 @@ import { Mnemonic } from '../../shared/classes/mnemonic';
})
export class CreateComponent {
constructor(private globalService: GlobalService, private apiService: ApiService, private fb: FormBuilder) {
constructor(private globalService: GlobalService, private apiService: ApiService, private router: Router, private fb: FormBuilder) {
this.createWalletForm = fb.group({
"walletName": ["", Validators.required],
"walletPassword": ["", Validators.required],
......@@ -28,6 +29,10 @@ export class CreateComponent {
private responseMessage: string;
private errorMessage: string;
private onBackClicked() {
this.router.navigate(["/setup"]);
}
private onCreateClicked() {
this.newWallet = new WalletCreation(
this.createWalletForm.get("walletPassword").value,
......
......@@ -25,4 +25,7 @@
<div class="form-group">
<button type="submit" [disabled]="!recoverWalletForm.valid" class="btn btn-success">Recover Wallet</button>
</div>
<div class="form-group">
<button type="button" class="btn btn-success" (click)="onBackClicked()">Back</button>
</div>
</form>
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators, FormBuilder } from '@angular/forms';
import { Router } from '@angular/router';
import { GlobalService } from '../../shared/services/global.service';
import { ApiService } from '../../shared/services/api.service';
......@@ -13,7 +14,7 @@ import { WalletRecovery } from '../../shared/classes/wallet-recovery';
})
export class RecoverComponent implements OnInit {
constructor(private globalService: GlobalService, private apiService: ApiService, private fb: FormBuilder) {
constructor(private globalService: GlobalService, private apiService: ApiService, private router: Router, private fb: FormBuilder) {
this.recoverWalletForm = fb.group({
"walletMnemonic": ["", Validators.required],
"walletPassword": ["", Validators.required],
......@@ -31,6 +32,10 @@ export class RecoverComponent implements OnInit {
ngOnInit() {
}
private onBackClicked() {
this.router.navigate(["/setup"]);
}
private onRecoverClicked(){
this.walletRecovery = new WalletRecovery(
this.recoverWalletForm.get("walletMnemonic").value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment