Skip to content

Commit

Permalink
Only close adapter if it is open on error (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
thegoldenmule committed Jul 4, 2024
1 parent 03e0c19 commit 1e3d21c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/nakama-js/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,10 @@ export class DefaultSocket implements Socket {
}
this.adapter.onError = (evt: Event) => {
reject(evt);
this.adapter.close();

if (this.adapter.isOpen()) {
this.adapter.close();
}
}


Expand Down

0 comments on commit 1e3d21c

Please sign in to comment.