Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
fix: use WebSocket.OPEN constant
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed May 11, 2019
1 parent a2d2b57 commit 58e1aad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 58e1aad

Please sign in to comment.