Wallet/src/js/controllers/modals/wallets.js

27 lines
642 B
JavaScript
Raw Normal View History

'use strict';
angular.module('copayApp.controllers').controller('walletsController', function($scope, $timeout, bwcError, profileService) {
2016-06-16 21:49:35 -03:00
$scope.selectWallet = function(walletId) {
var client = profileService.getClient(walletId);
$scope.errorSelectedWallet = {};
profileService.isReady(client, function(err) {
2016-07-11 11:46:48 -03:00
if (err) {
$scope.errorSelectedWallet[walletId] = bwcError.msg(err);
$timeout(function() {
$scope.$apply();
});
return;
}
$scope.$emit('walletSelected', walletId);
});
};
$scope.cancel = function() {
$scope.walletsModal.hide();
};
});