diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2019-02-09 15:10:49 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2019-02-09 15:10:49 -0500 |
| commit | c704e84787651b7d9eaa25c597321f8985a59b6b (patch) | |
| tree | 67be5d492bee22fe0ef704dddc5deb6809f4fe2b /www | |
| parent | 9d2ae83c10d98c4dedf67680d15a74e3945c9977 (diff) | |
fixes #780
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/EventServer.js | 13 |
1 files changed, 11 insertions, 2 deletions
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(); } + + + } }); }); |
