diff --git a/src/realtime/connection.js b/src/realtime/connection.js index 38fb031..ce3a303 100644 --- a/src/realtime/connection.js +++ b/src/realtime/connection.js @@ -100,7 +100,7 @@ class RealtimeConnection extends Events { * @param {string} data - The message data */ send(data) { - if (this._socket && this._socket.readyState === 1) { + if (this._socket && this._socket.readyState === WebSocket.OPEN) { this._socket.send(data); } }