mirror of https://github.com/BTCPrivate/copay.git
Fix receive-tab for wallets not backed up
This commit is contained in:
parent
0a7ba4bd02
commit
30240d30cd
|
@ -1,6 +1,6 @@
|
|||
'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 = [];
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
|
@ -20,7 +20,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
|
|||
$scope.generatingAddress = true;
|
||||
walletService.getAddress($scope.wallet, forceNew, function(err, addr) {
|
||||
$scope.generatingAddress = false;
|
||||
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||
if (err) popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err));
|
||||
$scope.addr = addr;
|
||||
if ($scope.walletAddrs[$scope.wallet.id]) $scope.walletAddrs[$scope.wallet.id] = addr;
|
||||
$timeout(function() {
|
||||
|
|
|
@ -779,15 +779,14 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
|||
|
||||
if (!forceNew && addr) return cb(null, addr);
|
||||
|
||||
root.isReady(wallet, function(err) {
|
||||
if (err) return cb(err);
|
||||
if (!wallet.isComplete())
|
||||
return cb('WALLET_NOT_COMPLETE');
|
||||
|
||||
createAddress(wallet, function(err, _addr) {
|
||||
if (err) return cb(err, addr);
|
||||
storageService.storeLastAddress(wallet.id, _addr, function() {
|
||||
if (err) return cb(err);
|
||||
return cb(null, _addr);
|
||||
});
|
||||
createAddress(wallet, function(err, _addr) {
|
||||
if (err) return cb(err, addr);
|
||||
storageService.storeLastAddress(wallet.id, _addr, function() {
|
||||
if (err) return cb(err);
|
||||
return cb(null, _addr);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue