We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b9e83e commit 4dc2cedCopy full SHA for 4dc2ced
client/index.js
@@ -16,6 +16,7 @@ if (typeof __resourceQuery === "string" && __resourceQuery) {
16
var sock = null;
17
var hot = false;
18
var initial = true;
19
+var connected = false;
20
var currentHash = "";
21
var logLevel = "info";
22
@@ -81,7 +82,10 @@ var newConnection = function() {
81
82
}));
83
84
sock.onclose = function() {
- log("error", "[WDS] Disconnected!");
85
+ if (connected)
86
+ log("error", "[WDS] Disconnected!");
87
+
88
+ connected = false;
89
90
// Try to reconnect.
91
sock = null;
@@ -91,6 +95,7 @@ var newConnection = function() {
95
};
92
96
93
97
sock.onmessage = function(e) {
98
+ connected = true;
94
99
// This assumes that all data sent via the websocket is JSON.
100
var msg = JSON.parse(e.data);
101
onSocketMsg[msg.type](msg.data);
0 commit comments