From da3b8dc846c13799b66ce7f02145a75c55cf395f Mon Sep 17 00:00:00 2001 From: Nirothipan Date: Fri, 14 Jul 2017 11:41:51 +0530 Subject: [PATCH] fixing broken pipe issue --- .../public/js/device-stats.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view/public/js/device-stats.js b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view/public/js/device-stats.js index d24b1918c..04feca7ec 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view/public/js/device-stats.js +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view/public/js/device-stats.js @@ -73,9 +73,9 @@ $(window).load(function () { connect(websocketUrl) }); -$(window).unload(function () { +window.onbeforeunload = function() { disconnect(); -}); +}; //websocket connection function connect(target) {