From 0a4eb0f3be7efc8017f1f1b33eee9556b2014785 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Mon, 30 Jun 2014 12:00:14 -0300 Subject: [PATCH] fix network error on logout --- js/controllers/header.js | 10 ---------- js/services/controllerUtils.js | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/js/controllers/header.js b/js/controllers/header.js index 0890ad624..a638f7a2c 100644 --- a/js/controllers/header.js +++ b/js/controllers/header.js @@ -48,16 +48,6 @@ angular.module('copayApp.controllers').controller('HeaderController', $rootScope.insightError = 0; - $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 + ')'); - } - } - }); - // Init socket handlers (with no wallet yet) controllerUtils.setSocketHandlers(); diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index a993bd635..342b33cdf 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -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;