File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ if (typeof __resourceQuery === "string" && __resourceQuery) {
16
16
var sock = null ;
17
17
var hot = false ;
18
18
var initial = true ;
19
+ var connected = false ;
19
20
var currentHash = "" ;
20
21
var logLevel = "info" ;
21
22
@@ -81,7 +82,10 @@ var newConnection = function() {
81
82
} ) ) ;
82
83
83
84
sock . onclose = function ( ) {
84
- log ( "error" , "[WDS] Disconnected!" ) ;
85
+ if ( connected )
86
+ log ( "error" , "[WDS] Disconnected!" ) ;
87
+
88
+ connected = false ;
85
89
86
90
// Try to reconnect.
87
91
sock = null ;
@@ -91,6 +95,7 @@ var newConnection = function() {
91
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.
95
100
var msg = JSON . parse ( e . data ) ;
96
101
onSocketMsg [ msg . type ] ( msg . data ) ;
You can’t perform that action at this time.
0 commit comments