Skip to content

Commit

Permalink
Merge pull request #946 from ably/fix-reactnative-websocket-wasClean
Browse files Browse the repository at this point in the history
Fix wasClean implementation for reactnative websocket transport
  • Loading branch information
owenpearson authored Apr 5, 2022
2 parents 1d5528a + 5f86c08 commit b9fa7ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/lib/transport/websockettransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ class WebSocketTransport extends Transport {
let wasClean, code;
if (typeof ev == 'object') {
/* W3C spec-compatible */
wasClean = ev.wasClean;
code = ev.code;
// ev.wasClean is undefined in reactnative
wasClean = ev.wasClean || code === 1000;
} /*if(typeof(ev) == 'number')*/ else {
/* ws in node */
code = ev;
Expand Down

0 comments on commit b9fa7ff

Please sign in to comment.