Wallet/src/js/controllers/tab-home.js

37 lines
990 B
JavaScript
Raw Normal View History

2016-08-12 10:54:31 -03:00
'use strict';
angular.module('copayApp.controllers').controller('tabHomeController',
function($rootScope, $timeout, $scope, lodash, profileService, walletService, configService ) {
var self = this;
// wallet list change
$rootScope.$on('Local/WalletListUpdated', function(event) {
self.walletSelection = false;
self.setWallets();
});
$rootScope.$on('Local/ColorUpdated', function(event) {
self.setWallets();
});
$rootScope.$on('Local/AliasUpdated', function(event) {
self.setWallets();
});
2016-08-15 10:25:43 -03:00
self.setWallets = function() {
$scope.wallets = profileService.getWallets();
2016-08-12 10:54:31 -03:00
};
2016-08-15 10:25:43 -03:00
self.updateAllClients = function() {
lodash.each(profileService.getWallets(), function(wallet) {
walletService.updateStatus(wallet, {}, function(err, status) {
if (err) {} // TODO
2016-08-12 10:54:31 -03:00
});
});
}
self.setWallets();
self.updateAllClients();
$scope.bitpayCardEnabled = true; // TODO
});