From 58e1aad477fdaf5f71a07e2330bcaccac63371c5 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sat, 11 May 2019 10:45:38 -0700 Subject: [PATCH] fix: use WebSocket.OPEN constant --- src/App.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index c798d505..28e0783a 100755 --- a/src/App.js +++ b/src/App.js @@ -581,8 +581,11 @@ class App extends Component { }); console.log('subscribe', msg); - while (self.ws.readyState !== 1 /*OPEN*/) { - console.log('Waiting for ws.readyState to be 1: ', self.ws.readyState); + while (self.ws.readyState !== WebSocket.OPEN) { + console.log( + 'Waiting for ws.readyState to be OPEN (1): ', + self.ws.readyState, + ); await sleep(250); } self.ws.send(msg);