mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #795 from maraoz/bug/networking-error
fix networking error on logout
This commit is contained in:
commit
180f40f6d1
|
@ -94,6 +94,7 @@ var defaultConfig = {
|
|||
totalCopayers: 3,
|
||||
spendUnconfirmed: true,
|
||||
verbose: 1,
|
||||
// will duplicate itself after each try
|
||||
reconnectDelay: 5000,
|
||||
},
|
||||
|
||||
|
@ -109,8 +110,7 @@ var defaultConfig = {
|
|||
schema: 'https',
|
||||
host: 'insight.bitpay.com',
|
||||
port: 443,
|
||||
// will duplicate itself after each try
|
||||
reconnectDelay: 500,
|
||||
reconnectDelay: 1000,
|
||||
},
|
||||
|
||||
// local encryption/security config
|
||||
|
|
|
@ -30,7 +30,7 @@ angular.module('copayApp.controllers').controller('HeaderController',
|
|||
};
|
||||
var latestVersion = data[0].name.replace('v', '').split('.').map(toInt);
|
||||
var currentVersion = copay.version.split('.').map(toInt);
|
||||
var title = 'Copay '+data[0].name+' available.';
|
||||
var title = 'Copay ' + data[0].name + ' available.';
|
||||
var content;
|
||||
if (currentVersion[0] < latestVersion[0]) {
|
||||
content = 'It\'s important that you update your wallet at https://copay.io';
|
||||
|
@ -48,15 +48,6 @@ angular.module('copayApp.controllers').controller('HeaderController',
|
|||
$rootScope.insightError = 0;
|
||||
|
||||
|
||||
$rootScope.$watch('insightError', function(status) {
|
||||
if (status === -1) {
|
||||
notification.success('Networking restored', 'Connection to Insight re-established');
|
||||
//$rootScope.insightError = 0;
|
||||
} else if (status !== 0) {
|
||||
notification.error('Networking problem', 'Connection to Insight lost, reconnecting (attempt number '+status+')');
|
||||
}
|
||||
});
|
||||
|
||||
// Init socket handlers (with no wallet yet)
|
||||
controllerUtils.setSocketHandlers();
|
||||
|
||||
|
|
|
@ -252,6 +252,16 @@ angular.module('copayApp.services')
|
|||
$rootScope.pendingTxCount = pendingForUs;
|
||||
};
|
||||
|
||||
$rootScope.$watch('insightError', function(status) {
|
||||
if (status) {
|
||||
if (status === -1) {
|
||||
notification.success('Networking restored', 'Connection to Insight re-established');
|
||||
} else if (!isNaN(status)) {
|
||||
notification.error('Networking problem', 'Connection to Insight lost, reconnecting (attempt number ' + status + ')');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
root._setCommError = function(e) {
|
||||
if ($rootScope.insightError < 0)
|
||||
$rootScope.insightError = 0;
|
||||
|
|
Loading…
Reference in New Issue