update to socket.io 1.0, adds connection error warnings
This commit is contained in:
parent
d88ef95789
commit
3a4bb56c26
6 changed files with 75 additions and 13 deletions
|
|
@ -174,12 +174,30 @@ angular.module('copayApp.services')
|
|||
$rootScope.pendingTxCount = pendingForUs;
|
||||
};
|
||||
|
||||
root._setCommError = function(e) {
|
||||
$rootScope.blockChainStatus='error';
|
||||
};
|
||||
|
||||
|
||||
root._clearCommError = function(e) {
|
||||
if ($rootScope.blockChainStatus==='error')
|
||||
$rootScope.blockChainStatus='restored';
|
||||
};
|
||||
|
||||
root.setSocketHandlers = function() {
|
||||
if (!Socket.sysEventsSet) {
|
||||
Socket.sysOn('error', root._setCommError);
|
||||
Socket.sysOn('reconnect_error', root._setCommError);
|
||||
Socket.sysOn('reconnect_failed', root._setCommError);
|
||||
Socket.sysOn('connect', root._clearCommError);
|
||||
Socket.sysOn('reconnect', root._clearCommError);
|
||||
Socket.sysEventsSet=true;
|
||||
}
|
||||
if (!$rootScope.wallet) return;
|
||||
|
||||
var currentAddrs= Socket.getListeners();
|
||||
var addrs = $rootScope.wallet.getAddressesStr();
|
||||
|
||||
|
||||
var newAddrs=[];
|
||||
for(var i in addrs){
|
||||
var a=addrs[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue