Merge pull request #444 from cmgustavo/feature/01-alert-txs

Feature/01 alert txs
This commit is contained in:
Mario Colque 2014-05-21 10:46:35 -03:00
commit 194ddc8079
6 changed files with 114 additions and 43 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copay.controllerUtils')
.factory('controllerUtils', function($rootScope, $sce, $location, Socket, video) {
.factory('controllerUtils', function($rootScope, $sce, $location, $notification, Socket, video) {
var root = {};
var bitcore = require('bitcore');
@ -49,6 +49,9 @@ angular.module('copay.controllerUtils')
};
$rootScope.$digest();
};
$notification.enableHtml5Mode(); // for chrome: if support, enable it
w.on('badMessage', function(peerId) {
$rootScope.$flashMessage = {
type: 'error',
@ -114,7 +117,6 @@ angular.module('copay.controllerUtils')
w.getBalance(function(balance, balanceByAddr, safeBalance) {
$rootScope.totalBalance = balance;
$rootScope.balanceByAddr = balanceByAddr;
$rootScope.selectedAddr = $rootScope.addrInfos[0].address.toString();
$rootScope.availableBalance = safeBalance;
$rootScope.updatingBalance = false;
console.log('Done updating balance.'); //TODO
@ -189,6 +191,7 @@ angular.module('copay.controllerUtils')
newAddrs.forEach(function(addr) {
Socket.on(addr, function(txid) {
console.log('Received!', txid);
$rootScope.receivedFund = [txid, addr];
root.updateBalance(function(){
$rootScope.$digest();
});