Merge pull request #4747 from cmgustavo/bug/bitcoin-uri-paypro

Fix uri handler
This commit is contained in:
Matias Alejo Garcia 2016-10-26 10:29:44 -03:00 committed by GitHub
commit 8a5e5d429c
1 changed files with 14 additions and 5 deletions

View File

@ -44,12 +44,21 @@ angular.module('copayApp.controllers').controller('paymentUriController',
});
};
var setAndStoreFocus = function(selectedWalletId, cb) {
var currentWalletId = profileService.focusedClient ? profileService.focusedClient.credentials.walletId : null;
if (currentWalletId && currentWalletId == selectedWalletId) return cb();
profileService.setAndStoreFocus(selectedWalletId, function() {
return cb();
});
};
this.selectWallet = function(wid) {
var self = this;
profileService.setAndStoreFocus(wid, function() {});
go.walletHome();
$timeout(function() {
$rootScope.$emit('paymentUri', self.bitcoinURI);
}, 1000);
setAndStoreFocus(wid, function() {
go.walletHome();
$timeout(function() {
$rootScope.$emit('paymentUri', self.bitcoinURI);
}, 1000);
});
};
});