Commit 662503f8 authored by Pieterjan Vanhoof's avatar Pieterjan Vanhoof Committed by GitHub

Merge pull request #78 from stratisproject/ui

Add temporary redirect after creating/recovering wallet
parents 8b25d8f1 09a2e498
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div class="row"> <div class="row">
<div class="col" id="mnemonic"> <div class="col" id="mnemonic">
<label>Mnemonic:</label> <label>Mnemonic:</label>
<label>{{responseMessage}}</label> <label>{{ mnemonic }}</label>
</div> </div>
</div> </div>
</div> </div>
...@@ -22,8 +22,7 @@ export class CreateComponent { ...@@ -22,8 +22,7 @@ export class CreateComponent {
private createWalletForm: FormGroup; private createWalletForm: FormGroup;
private newWallet: WalletCreation; private newWallet: WalletCreation;
private responseMessage: string; private mnemonic: string;
private errorMessage: string;
private buildCreateForm(): void { private buildCreateForm(): void {
this.createWalletForm = this.fb.group({ this.createWalletForm = this.fb.group({
...@@ -94,13 +93,15 @@ export class CreateComponent { ...@@ -94,13 +93,15 @@ export class CreateComponent {
.subscribe( .subscribe(
response => { response => {
if (response.status >= 200 && response.status < 400){ if (response.status >= 200 && response.status < 400){
this.responseMessage = response.json(); this.mnemonic = response.json();
alert("Your wallet has been created. Please write down your 12 word passphrase: \n" + this.mnemonic + "\nYou will be redirected to the decryption page.");
this.router.navigate(['']);
} }
}, },
error => { error => {
if (error.status >= 400) { if (error.status >= 400) {
this.errorMessage = error; let errorMessage = error;
console.log(this.errorMessage); console.log(errorMessage);
} }
} }
); );
......
...@@ -107,6 +107,8 @@ export class RecoverComponent implements OnInit { ...@@ -107,6 +107,8 @@ export class RecoverComponent implements OnInit {
response => { response => {
if (response.status >= 200 && response.status < 400) { if (response.status >= 200 && response.status < 400) {
this.responseMessage = response; this.responseMessage = response;
alert("Your wallet has been recovered. \nYou will be redirected to the decryption page.");
this.router.navigate([''])
} }
}, },
error => { error => {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* { * {
font-family: "Lato"; font-family: "Lato";
user-select: none;
} }
/* Temporary min td with */ /* Temporary min td with */
......
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