summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2015-01-23 04:18:19 +0200
committerLV-426 <lv-426@taproot.org.il>2015-01-23 04:18:19 +0200
commitd38f87bcc71c229a4c4b900fdf965de03b88a280 (patch)
tree54d019b98ebda62f9102df441982a577fd920884 /src
parent068b3878241c015a8570964eba475ff805453148 (diff)
switch to socket.disconnect()
Diffstat (limited to 'src')
-rw-r--r--src/client/rz_mesh.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/client/rz_mesh.js b/src/client/rz_mesh.js
index 2698b3d9..8057f553 100644
--- a/src/client/rz_mesh.js
+++ b/src/client/rz_mesh.js
@@ -34,12 +34,8 @@ define([ 'rz_config', 'util', 'model/diff', 'model/util', 'socketio'], function(
// attempt to actively disconnect on tab/window close
// ref: https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers.onbeforeunload
window.addEventListener("beforeunload", function(e){
- if (socket.close) {
- socket.close();
- console.log('ws: connection closed on \'beforeunload\' event'); // no one will ever see this but still
- } else {
- console.log('ws: wanted to close on \'beforeunload\' event but no close function');
- }
+ socket.disconnect();
+ console.log('ws: connection closed on \'beforeunload\' event'); // no one will ever see this but still
});
}