From c704e84787651b7d9eaa25c597321f8985a59b6b Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 9 Feb 2019 15:10:49 -0500 Subject: fixes #780 --- www/js/EventServer.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'www/js/EventServer.js') diff --git a/www/js/EventServer.js b/www/js/EventServer.js index e7defabd..0d09d0ab 100644 --- a/www/js/EventServer.js +++ b/www/js/EventServer.js @@ -279,8 +279,8 @@ angular.module('zmApp.controllers') return d.promise; } + function setupDesktopSocket() { - var loginData = NVR.getLogin(); var d = $q.defer(); ws = new WebSocket(loginData.eventServer); @@ -388,7 +388,13 @@ angular.module('zmApp.controllers') NVR.debug("~~~~ sendMessage: Sending->" + jmsg); if ($rootScope.platformOS == 'desktop') { - ws.send(jmsg); + try { + ws.send(jmsg); + } + catch (e) { + NVR.debug ("Exception sending ES message: "+JSON.stringify(e)); + } + } else { if (nativeWebSocketId != -1) CordovaWebsocketPlugin.wsSend(nativeWebSocketId, jmsg); @@ -674,6 +680,9 @@ angular.module('zmApp.controllers') if ($rootScope.alarmCount != "99+") { $rootScope.alarmCount = (parseInt($rootScope.alarmCount) + 1).toString(); } + + + } }); }); -- cgit v1.2.3