fix address generate

This commit is contained in:
Javier 2016-08-23 15:13:51 -03:00
commit 4231dcadc7
4 changed files with 8 additions and 58 deletions

View file

@ -44,7 +44,7 @@ Error: {{addrError}}
<i class="icon ion-ios-upload-outline"></i>
<span translate>Share address</span>
</div>
<div class="item item-icon-left" ng-click="setAddress(true)" ng-disabled="">
<div class="item item-icon-left" ng-click="setAddress(null, true)" ng-disabled="">
<i class="icon ion-ios-loop"></i>
<span translate>Next Address</span>
</div>
@ -54,27 +54,8 @@ Error: {{addrError}}
<span ng-show="!generatingAddress" copy-to-clipboard="addr">{{addr}}</span>
</div>
</div>
<wallets only-complete="false"></wallets>
<!-- <div class="item item-text-wrap" ng-style="{'height' : '200px'}">
<ion-slides class="slides" options="options" slider="data.slider">
<ion-slide-page ng-repeat="item in wallets track by $index" >
<div class="list card">
<ul class="pr">
<li ng-show="wallets[0]" class="item item-icon-left">
<i class="icon ion-briefcase size-21" ng-style="{'color':item.color}"></i>
{{item.name || item.id}}
<span class="item-note" ng-show="item.n > 1 && item.isComplete()">
{{item.m}}-of-{{item.n}}
</span>
<span class="badge badge-assertive" ng-show="!item.isComplete()" translate>
Incomplete
</span>
</li>
</ul>
</div>
</ion-slide-page>
</ion-slides>
</div> -->
<wallets></wallets>
</ion-content>
</ion-view>

View file

@ -18,7 +18,6 @@
<div class="item item-divider">
Preferences
</div>
<wallets></wallets>
<div class="list">
<div class="item item-icon-left" href ui-sref="settings.language">
<i class="icon ion-ios-chatbubble-outline"></i>

View file

@ -5,37 +5,14 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.isCordova = platformInfo.isCordova;
$scope.init = function() {
$scope.index = 0;
$scope.defaultWallet = profileService.getWallets()[0];
$scope.isCordova = platformInfo.isCordova;
$scope.isNW = platformInfo.isNW;
// $scope.setWallets();
$scope.setAddress(false);
// $scope.options = {
// loop: false,
// effect: 'flip',
// speed: 500,
// spaceBetween: 100
// }
//
// $scope.$on("$ionicSlides.sliderInitialized", function(event, data) {
// // data.slider is the instance of Swiper
// $scope.slider = data.slider;
// });
//
// $scope.$on("$ionicSlides.slideChangeStart", function(event, data) {
// console.log('Slide change is beginning');
// });
//
// $scope.$on("$ionicSlides.slideChangeEnd", function(event, data) {
// $scope.index = data.slider.activeIndex;
// $scope.setAddress();
// });
}
$scope.copyToClipboard = function(addr, $event) {
var showPopover = function() {
$ionicPopover.fromTemplateUrl('views/includes/copyToClipboard.html', {
scope: $scope
}).then(function(popover) {
@ -66,8 +43,8 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
};
$scope.$on('Wallet/Changed', function(event, wallet) {
console.log(wallet);
$log.debug('Wallet changed: ' + wallet.name);
$scope.defaultWallet = wallet;
$scope.setAddress(wallet);
});
@ -78,13 +55,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
};
$scope.setAddress = function(wallet, forceNew) {
if (!wallet) return;
var wallet = wallet || $scope.defaultWallet;
if ($scope.generatingAddress) return;
$scope.addr = null;
$scope.addrError = null;
if (!wallet.isComplete()) {
if (wallet && !wallet.isComplete()) {
$scope.incomplete = true;
$timeout(function() {
$scope.$digest();
@ -108,10 +85,4 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
});
});
};
$scope.setWallets = function() {
$scope.wallets = profileService.getWallets();
};
});

View file

@ -159,8 +159,7 @@ angular.module('copayApp.directives')
scope.$on("$ionicSlides.sliderInitialized", function(event, data) {
scope.slider = data.slider;
scope.content.index = data.slider.activeIndex;
scope.$emit('Wallet/Changed', scope.content.wallets[scope.content.index]);
scope.$emit('Wallet/Changed', scope.content.wallets[0]);
});
scope.$on("$ionicSlides.slideChangeEnd", function(event, data) {