Commit b53d83de authored by dev0tion's avatar dev0tion

Add back button to recover and create process

parent 67ea0921
...@@ -28,4 +28,7 @@ ...@@ -28,4 +28,7 @@
<div> <div>
<label>{{responseMessage}}</label> <label>{{responseMessage}}</label>
</div> </div>
<div class="form-group">
<button type="button" class="btn btn-success" (click)="onBackClicked()">Back</button>
</div>
</div> </div>
import { Component, Injectable } from '@angular/core'; import { Component, Injectable } from '@angular/core';
import { FormGroup, FormControl, Validators, FormBuilder } from '@angular/forms'; import { FormGroup, FormControl, Validators, FormBuilder } from '@angular/forms';
import { Router } from '@angular/router';
import { GlobalService } from '../../shared/services/global.service'; import { GlobalService } from '../../shared/services/global.service';
import { ApiService } from '../../shared/services/api.service'; import { ApiService } from '../../shared/services/api.service';
...@@ -14,7 +15,7 @@ import { Mnemonic } from '../../shared/classes/mnemonic'; ...@@ -14,7 +15,7 @@ import { Mnemonic } from '../../shared/classes/mnemonic';
}) })
export class CreateComponent { 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({ this.createWalletForm = fb.group({
"walletName": ["", Validators.required], "walletName": ["", Validators.required],
"walletPassword": ["", Validators.required], "walletPassword": ["", Validators.required],
...@@ -28,6 +29,10 @@ export class CreateComponent { ...@@ -28,6 +29,10 @@ export class CreateComponent {
private responseMessage: string; private responseMessage: string;
private errorMessage: string; private errorMessage: string;
private onBackClicked() {
this.router.navigate(["/setup"]);
}
private onCreateClicked() { private onCreateClicked() {
this.newWallet = new WalletCreation( this.newWallet = new WalletCreation(
this.createWalletForm.get("walletPassword").value, this.createWalletForm.get("walletPassword").value,
......
...@@ -25,4 +25,7 @@ ...@@ -25,4 +25,7 @@
<div class="form-group"> <div class="form-group">
<button type="submit" [disabled]="!recoverWalletForm.valid" class="btn btn-success">Recover Wallet</button> <button type="submit" [disabled]="!recoverWalletForm.valid" class="btn btn-success">Recover Wallet</button>
</div> </div>
<div class="form-group">
<button type="button" class="btn btn-success" (click)="onBackClicked()">Back</button>
</div>
</form> </form>
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators, FormBuilder } from '@angular/forms'; import { FormGroup, FormControl, Validators, FormBuilder } from '@angular/forms';
import { Router } from '@angular/router';
import { GlobalService } from '../../shared/services/global.service'; import { GlobalService } from '../../shared/services/global.service';
import { ApiService } from '../../shared/services/api.service'; import { ApiService } from '../../shared/services/api.service';
...@@ -13,7 +14,7 @@ import { WalletRecovery } from '../../shared/classes/wallet-recovery'; ...@@ -13,7 +14,7 @@ import { WalletRecovery } from '../../shared/classes/wallet-recovery';
}) })
export class RecoverComponent implements OnInit { 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({ this.recoverWalletForm = fb.group({
"walletMnemonic": ["", Validators.required], "walletMnemonic": ["", Validators.required],
"walletPassword": ["", Validators.required], "walletPassword": ["", Validators.required],
...@@ -31,6 +32,10 @@ export class RecoverComponent implements OnInit { ...@@ -31,6 +32,10 @@ export class RecoverComponent implements OnInit {
ngOnInit() { ngOnInit() {
} }
private onBackClicked() {
this.router.navigate(["/setup"]);
}
private onRecoverClicked(){ private onRecoverClicked(){
this.walletRecovery = new WalletRecovery( this.walletRecovery = new WalletRecovery(
this.recoverWalletForm.get("walletMnemonic").value, 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