diff --git a/src/js/controllers/addresses.js b/src/js/controllers/addresses.js index 4a95c4618..5b08ac0cd 100644 --- a/src/js/controllers/addresses.js +++ b/src/js/controllers/addresses.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('addressesController', function($scope, $stateParams, $state, $timeout, $ionicScrollDelegate, configService, popupService, gettextCatalog, ongoingProcess, lodash, profileService, walletService, bwcError) { +angular.module('copayApp.controllers').controller('addressesController', function($scope, $stateParams, $state, $timeout, $ionicScrollDelegate, configService, popupService, gettextCatalog, ongoingProcess, lodash, profileService, walletService) { var UNUSED_ADDRESS_LIMIT = 5; var BALANCE_ADDRESS_LIMIT = 5; var config; @@ -10,6 +10,7 @@ angular.module('copayApp.controllers').controller('addressesController', functio var unitDecimals; var withBalance; $scope.showInfo = false; + $scope.showMore = false; $scope.wallet = profileService.getWallet($stateParams.walletId); function init() { @@ -60,11 +61,17 @@ angular.module('copayApp.controllers').controller('addressesController', functio }; $scope.newAddress = function() { + if ($scope.gapReached) return; + ongoingProcess.set('generatingNewAddress', true); walletService.getAddress($scope.wallet, true, function(err, addr) { if (err) { ongoingProcess.set('generatingNewAddress', false); - return popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err)); + $scope.gapReached = true; + $timeout(function() { + $scope.$digest(); + }); + return; } walletService.getMainAddresses($scope.wallet, { @@ -97,6 +104,13 @@ angular.module('copayApp.controllers').controller('addressesController', functio }); }; + $scope.readMore = function() { + $timeout(function() { + $scope.showMore = !$scope.showMore; + $ionicScrollDelegate.resize(); + }); + }; + $scope.$on("$ionicView.beforeEnter", function(event, data) { config = configService.getSync().wallet.settings; unitToSatoshi = config.unitToSatoshi; diff --git a/src/sass/views/addresses.scss b/src/sass/views/addresses.scss index ac82961f4..4e3ed9106 100644 --- a/src/sass/views/addresses.scss +++ b/src/sass/views/addresses.scss @@ -73,6 +73,23 @@ margin-right: 2px; } } + .box-error { + padding: 25px; + background-color: #E65555; + color: #F4F4F4; + h5 { + margin: 5px; + color: #F4F4F4; + text-align: center; + font-weight: bold; + } + a { + font-weight: bold; + color: #F4F4F4; + cursor: pointer; + cursor: hand; + } + } .item-note { color: $light-gray; } diff --git a/www/views/addresses.html b/www/views/addresses.html index e38e7f1b3..81a3ebaf0 100644 --- a/www/views/addresses.html +++ b/www/views/addresses.html @@ -6,19 +6,19 @@ -
+
-
+
Each bitcoin wallet can generate billions of addresses from your 12-word backup. A new address is automatically generated and shown each time your recive a payment. Why?
-
+
It's a good idea to avoid reusing addresses-this both protects your privacy and keeps your bitcoins secure against hypothetical attacks by quantum computers. Hide
@@ -30,6 +30,12 @@
+
+
Unused Addresses Limit
+

The maximum number of consecutive unused addresses (20) has been reached. When one of your unused addresses receives a payment, a new address will be generated and shown in your Receive tab. Read more

+

The restore process will stop when 20 addresses are generated in a row which contain no funds. To safely generate more addresses, make a payment to one of the unused addresses which has already been generated. Read less

+
+
{{u.address}}