add incomplete wallets to receive tab

This commit is contained in:
Gabriel Bazán 2016-09-26 11:26:10 -03:00
parent 7cee9a22a5
commit 3a1129e1f8
4 changed files with 78 additions and 36 deletions

View File

@ -8,10 +8,6 @@
<span class="item-note m10l" ng-show="wallet.n > 1 && wallet.isComplete()">
{{wallet.m}}-of-{{wallet.n}}
</span>
<span class="badge badge-assertive" ng-show="!wallet.isComplete()" translate>
Incomplete
</span>
<!-- <i ng-show="wallet.needsBackup" class="icon ion-android-warning assertive"></i> -->
</div>
</div>
</ion-slide-page>

View File

@ -8,42 +8,62 @@
</ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<article id="address">
<div class="row">
<div class="m15t text-center col center-block" copy-to-clipboard="addr">
<qrcode ng-if="addr" size="220" data="bitcoin:{{addr}}"></qrcode>
<div ng-if="!addr" style="height:220px; width:220px; margin:auto; background: white; padding-top: 20%;">
...
<div id="address">
<article class="text-center" ng-if="!wallet.isComplete()">
<div class="incomplete">
<div class="title">
<span translate>Incomplete wallet</span>
</div>
<div ng-if="wallet.needsBackup" class="assertive m10t" translate>
Before receiving funds, you must backup your wallet. If this device is lost, it is impossible to access your funds without a backup.
<div class="subtitle">
<span translate>All signing devices must be added to this multisig wallet before bitcoin addresses can be created.</span>
</div>
<div>
<button class="button button-block button-positive" ng-click="goCopayers()" translate>Open wallet</button>
</div>
</div>
</div>
<div class="row">
<div class="col" ng-show="isCordova && addr">
<div class="item item-icon-left" ng-click="shareAddress(addr)">
<i class="icon ion-ios-upload-outline"></i>
<span translate>Share</span>
<div class="row border-top">
<div class="col col-90 center-block bit-address text-center">
<div class="item item-icon-left">
<i class="icon ion-social-bitcoin-outline"></i>
<span class="bit-address-gen-address" ng-if="!generatingAddress" translate>address not yet available</span>
</div>
</div>
</div>
<div class="col" ng-class="{'center-block col-50': !isCordova || !addr}">
<div class="item item-icon-left" ng-click="setAddress(true)">
<i class="icon ion-ios-loop"></i>
<span translate>Next Address</span>
</article>
<article ng-if="wallet.isComplete()">
<div class="row">
<div class="m15t text-center col center-block" copy-to-clipboard="addr">
<qrcode ng-if="addr" size="220" data="bitcoin:{{addr}}"></qrcode>
<div ng-if="!addr" style="height:220px; width:220px; margin:auto; background: white; padding-top: 20%;">
...
</div>
</div>
</div>
</div>
<div class="row border-top">
<div class="col col-90 center-block bit-address text-center">
<div class="item item-icon-left">
<i class="icon ion-social-bitcoin-outline"></i>
<span ng-if="generatingAddress">...</span>
<span class="bit-address-gen-address" ng-if="!generatingAddress" copy-to-clipboard="addr">{{addr}}</span>
<div class="row">
<div class="col" ng-show="isCordova && addr">
<div class="item item-icon-left" ng-click="shareAddress(addr)">
<i class="icon ion-ios-upload-outline"></i>
<span translate>Share</span>
</div>
</div>
<div class="col" ng-class="{'center-block col-50': !isCordova || !addr}">
<div class="item item-icon-left" ng-click="setAddress(true)">
<i class="icon ion-ios-loop"></i>
<span translate>Next Address</span>
</div>
</div>
</div>
</div>
</article>
<div class="row border-top">
<div class="col col-90 center-block bit-address text-center">
<div class="item item-icon-left">
<i class="icon ion-social-bitcoin-outline"></i>
<span ng-if="generatingAddress">...</span>
<span class="bit-address-gen-address" ng-if="!generatingAddress" copy-to-clipboard="addr">{{addr}}</span>
</div>
</div>
</div>
</article>
</div>
<article id="wallets">
<div class="list card padding text-center" ng-if="!wallets[0]">
<span translate>No Wallet</span>

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('tabReceiveController', function($scope, $timeout, $log, $ionicModal, storageService, platformInfo, walletService, profileService, configService, lodash, gettextCatalog, popupService) {
angular.module('copayApp.controllers').controller('tabReceiveController', function($scope, $timeout, $log, $ionicModal, $state, $ionicHistory, storageService, platformInfo, walletService, profileService, configService, lodash, gettextCatalog, popupService) {
$scope.isCordova = platformInfo.isCordova;
$scope.isNW = platformInfo.isNW;
@ -29,7 +29,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
};
$scope.setAddress = function(forceNew) {
if ($scope.generatingAddress) return;
if ($scope.generatingAddress || !$scope.wallet.isComplete()) return;
$scope.addr = null;
$scope.generatingAddress = true;
@ -46,9 +46,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.$on("$ionicView.beforeEnter", function(event, data) {
if (!$scope.isCordova) $scope.checkTips();
$scope.wallets = profileService.getWallets({
onlyComplete: true
});
$scope.wallets = profileService.getWallets();
$scope.$on('Wallet/Changed', function(event, wallet) {
if (!wallet) {
$log.debug('No wallet provided');
@ -59,4 +57,18 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.setAddress();
});
});
$scope.goCopayers = function() {
$ionicHistory.removeBackView();
$ionicHistory.nextViewOptions({
disableAnimate: true
});
$state.go('tabs.home');
$timeout(function() {
$state.transitionTo('tabs.copayers', {
walletId: $scope.wallet.credentials.walletId
});
}, 100);
};
});

View File

@ -9,6 +9,20 @@
}
#address {
background: #fff;
.incomplete {
padding: 50px;
.title {
padding: 20px;
font-size: 25px;
color: #444;
}
.subtitle {
padding: 20px;
color: #444;
}
.button {
}
}
.item {
border: none;
font-size: .8rem;