Fix: Message for receive view when there is no wallets

This commit is contained in:
Gabriel Masclef 2017-10-31 16:53:36 -03:00
parent 2dfd458114
commit f736b80fa4
No known key found for this signature in database
GPG Key ID: DD6D7EAADE12280D
2 changed files with 28 additions and 29 deletions

View File

@ -1,34 +1,28 @@
<!--
Generated template for the ReceivePage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header> <ion-header>
<ion-navbar> <ion-navbar>
<ion-title>Receive</ion-title> <ion-title>Receive</ion-title>
</ion-navbar> </ion-navbar>
</ion-header> </ion-header>
<ion-content padding> <ion-content padding>
<div class="qr-container"> <div *ngIf="wallet" class="qr-container">
<qr-code *ngIf="address" [value]="qrAddress" [level]="M" [size]="220" [foreground]="'#334'"></qr-code> <qr-code *ngIf="address" [value]="qrAddress" [level]="M" [size]="220" [foreground]="'#334'"></qr-code>
<div> <div>
<span>{{ address }}</span> <span>{{ address }}</span>
</div> </div>
<div> <div>
<button [hidden]="!address" class="button-request" (click)="requestSpecificAmount()"> <button [hidden]="!address" class="button-request" (click)="requestSpecificAmount()">
<span>Request Specific amount</span> <span>Request Specific amount</span>
<ion-icon name="arrow-forward"></ion-icon> <ion-icon name="arrow-forward"></ion-icon>
</button>
</div>
<div>
<button [hidden]="!address" class="button-address" (click)="setAddress(true)">
<span>Generate new address</span>
</button> </button>
</div> </div>
<div>
<button [hidden]="!address" class="button-address" (click)="setAddress(true)">
<span>Generate new address</span>
</button>
</div>
</div> </div>
</ion-content> <div *ngIf="!wallet">
<span>No wallet</span>
</div>
</ion-content>

View File

@ -24,19 +24,24 @@ export class ReceivePage {
private profileProvider: ProfileProvider, private profileProvider: ProfileProvider,
private walletProvider: WalletProvider private walletProvider: WalletProvider
) { ) {
this.wallets = this.profileProvider.getWallets();
this.updateQrAddress();
} }
ionViewDidLoad() { ionViewDidLoad() {
console.log('ionViewDidLoad ReceivePage'); console.log('ionViewDidLoad ReceivePage');
}
ionViewDidEnter() {
this.wallets = this.profileProvider.getWallets();
this.updateQrAddress();
this.onSelect(this.checkSelectedWallet(this.wallet, this.wallets)); this.onSelect(this.checkSelectedWallet(this.wallet, this.wallets));
} }
private onSelect(wallet: any): any { private onSelect(wallet: any): any {
this.wallet = wallet; this.wallet = wallet;
this.setProtocolHandler(); if (this.wallet) {
this.setAddress(); this.setProtocolHandler();
this.setAddress();
}
} }
private setProtocolHandler(): void { private setProtocolHandler(): void {