Fix receive-tab for wallets not backed up
This commit is contained in:
parent
0a7ba4bd02
commit
30240d30cd
2 changed files with 9 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('tabReceiveController', function($rootScope, $scope, $timeout, $log, $ionicModal, $state, $ionicHistory, storageService, platformInfo, walletService, profileService, configService, lodash, gettextCatalog, popupService) {
|
angular.module('copayApp.controllers').controller('tabReceiveController', function($rootScope, $scope, $timeout, $log, $ionicModal, $state, $ionicHistory, storageService, platformInfo, walletService, profileService, configService, lodash, gettextCatalog, popupService, bwcError) {
|
||||||
|
|
||||||
var listeners = [];
|
var listeners = [];
|
||||||
$scope.isCordova = platformInfo.isCordova;
|
$scope.isCordova = platformInfo.isCordova;
|
||||||
|
|
@ -20,7 +20,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
|
||||||
$scope.generatingAddress = true;
|
$scope.generatingAddress = true;
|
||||||
walletService.getAddress($scope.wallet, forceNew, function(err, addr) {
|
walletService.getAddress($scope.wallet, forceNew, function(err, addr) {
|
||||||
$scope.generatingAddress = false;
|
$scope.generatingAddress = false;
|
||||||
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
|
if (err) popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err));
|
||||||
$scope.addr = addr;
|
$scope.addr = addr;
|
||||||
if ($scope.walletAddrs[$scope.wallet.id]) $scope.walletAddrs[$scope.wallet.id] = addr;
|
if ($scope.walletAddrs[$scope.wallet.id]) $scope.walletAddrs[$scope.wallet.id] = addr;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
|
|
||||||
|
|
@ -779,15 +779,14 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
|
|
||||||
if (!forceNew && addr) return cb(null, addr);
|
if (!forceNew && addr) return cb(null, addr);
|
||||||
|
|
||||||
root.isReady(wallet, function(err) {
|
if (!wallet.isComplete())
|
||||||
if (err) return cb(err);
|
return cb('WALLET_NOT_COMPLETE');
|
||||||
|
|
||||||
createAddress(wallet, function(err, _addr) {
|
createAddress(wallet, function(err, _addr) {
|
||||||
if (err) return cb(err, addr);
|
if (err) return cb(err, addr);
|
||||||
storageService.storeLastAddress(wallet.id, _addr, function() {
|
storageService.storeLastAddress(wallet.id, _addr, function() {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
return cb(null, _addr);
|
return cb(null, _addr);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue