diff --git a/public/views/tab-receive.html b/public/views/tab-receive.html
index 7e338b681..f9aaf7d89 100644
--- a/public/views/tab-receive.html
+++ b/public/views/tab-receive.html
@@ -44,7 +44,7 @@ Error: {{addrError}}
Share address
-
diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js
index d46bd1e69..01471d553 100644
--- a/src/js/controllers/tab-receive.js
+++ b/src/js/controllers/tab-receive.js
@@ -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();
- };
-
});
diff --git a/src/js/directives/directives.js b/src/js/directives/directives.js
index 945511b1e..513be5ea4 100644
--- a/src/js/directives/directives.js
+++ b/src/js/directives/directives.js
@@ -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) {