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

40 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-08-12 10:54:31 -03:00
'use strict';
angular.module('copayApp.controllers').controller('tabHomeController',
2016-08-17 13:16:06 -03:00
function($rootScope, $timeout, $scope, $state, lodash, profileService, walletService, configService ) {
2016-08-12 10:54:31 -03:00
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-17 15:23:17 -03:00
self.setWallets = function() {
2016-08-15 10:25:43 -03:00
$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
2016-08-17 13:16:06 -03:00
2016-08-17 17:31:45 -03:00
// $state.transitionTo('confirm', {toAmount:555500, toAddress: 'mvfAwUJohJWibGzBZgAUGsDarsr4Z4NovU', toName: 'bla bla'});
2016-08-12 10:54:31 -03:00
});