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-navbar>
<ion-title>Receive</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<div class="qr-container">
<qr-code *ngIf="address" [value]="qrAddress" [level]="M" [size]="220" [foreground]="'#334'"></qr-code>
<div>
<span>{{ address }}</span>
</div>
<div>
<button [hidden]="!address" class="button-request" (click)="requestSpecificAmount()">
<span>Request Specific amount</span>
<ion-icon name="arrow-forward"></ion-icon>
<div *ngIf="wallet" class="qr-container">
<qr-code *ngIf="address" [value]="qrAddress" [level]="M" [size]="220" [foreground]="'#334'"></qr-code>
<div>
<span>{{ address }}</span>
</div>
<div>
<button [hidden]="!address" class="button-request" (click)="requestSpecificAmount()">
<span>Request Specific amount</span>
<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>
</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 walletProvider: WalletProvider
) {
this.wallets = this.profileProvider.getWallets();
this.updateQrAddress();
}
ionViewDidLoad() {
console.log('ionViewDidLoad ReceivePage');
}
ionViewDidEnter() {
this.wallets = this.profileProvider.getWallets();
this.updateQrAddress();
this.onSelect(this.checkSelectedWallet(this.wallet, this.wallets));
}
private onSelect(wallet: any): any {
this.wallet = wallet;
this.setProtocolHandler();
this.setAddress();
if (this.wallet) {
this.setProtocolHandler();
this.setAddress();
}
}
private setProtocolHandler(): void {