diff --git a/app/assets/javascripts/editor/websocket.js b/app/assets/javascripts/editor/websocket.js index 09d64975..088e285f 100644 --- a/app/assets/javascripts/editor/websocket.js +++ b/app/assets/javascripts/editor/websocket.js @@ -4,7 +4,9 @@ CommandSocket = function(url, onOpen) { this.websocket.onopen = onOpen; this.websocket.onmessage = this.onMessage.bind(this); this.websocket.flush = function () { - this.send('\n'); + if (this.readyState === this.OPEN) { + this.send('\n'); + } } };