mirror of https://github.com/BTCPrivate/copay.git
several improvements
This commit is contained in:
parent
319417552a
commit
e928ca2b81
|
@ -9,21 +9,21 @@ angular.module('copay.addresses').controller('AddressesController',
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
|
|
||||||
var _updateBalance = function () {
|
var _updateBalance = function () {
|
||||||
|
controllerUtils.setSocketHandlers();
|
||||||
|
|
||||||
w.getBalance(function (balance, balanceByAddr) {
|
w.getBalance(function (balance, balanceByAddr) {
|
||||||
if (balanceByAddr && Object.keys(balanceByAddr).length) {
|
if (balanceByAddr && Object.keys(balanceByAddr).length) {
|
||||||
$scope.balanceByAddr = balanceByAddr;
|
$rootScope.balanceByAddr = balanceByAddr;
|
||||||
$scope.addrs = Object.keys(balanceByAddr);
|
$scope.addrs = Object.keys(balanceByAddr);
|
||||||
$scope.selectedAddr = $scope.addrs[0];
|
$scope.selectedAddr = $scope.addrs[0];
|
||||||
$scope.$digest();
|
$rootScope.$digest();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.newAddr = function() {
|
$scope.newAddr = function() {
|
||||||
w.generateAddress().toString();
|
w.generateAddress();
|
||||||
_updateBalance();
|
_updateBalance();
|
||||||
|
|
||||||
controllerUtils.setSocketHandlers();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.selectAddr = function(addr) {
|
$scope.selectAddr = function(addr) {
|
||||||
|
|
|
@ -27,6 +27,11 @@ angular.module('copay.header').controller('HeaderController',
|
||||||
$rootScope.$watch('wallet', function(wallet) {
|
$rootScope.$watch('wallet', function(wallet) {
|
||||||
if (wallet) {
|
if (wallet) {
|
||||||
controllerUtils.setSocketHandlers();
|
controllerUtils.setSocketHandlers();
|
||||||
|
$rootScope.wallet.getBalance(function(balance) {
|
||||||
|
$rootScope.$apply(function() {
|
||||||
|
$rootScope.totalBalance = balance;
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,8 @@ angular
|
||||||
validate: false
|
validate: false
|
||||||
})
|
})
|
||||||
.when('/addresses', {
|
.when('/addresses', {
|
||||||
templateUrl: 'addresses.html'
|
templateUrl: 'addresses.html',
|
||||||
|
validate: true
|
||||||
})
|
})
|
||||||
.when('/join/:id', {
|
.when('/join/:id', {
|
||||||
templateUrl: 'join.html',
|
templateUrl: 'join.html',
|
||||||
|
|
Loading…
Reference in New Issue