Skip to content

Commit

Permalink
Update pkgs/web_socket/lib/src/browser_web_socket.dart
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Bosch <[email protected]>
  • Loading branch information
brianquinlan and natebosch authored Mar 4, 2024
1 parent 3fe72a4 commit a04d018
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkgs/web_socket/lib/src/browser_web_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,9 @@ class BrowserWebSocket implements WebSocket {
}

void _closed(int? code, String? reason) {
if (!_events.isClosed) {
_events.add(CloseReceived(code, reason ?? ''));
unawaited(_events.close());
}
if (_events.isClosed) return;
_events.add(CloseReceived(code, reason ?? ''));
unawaited(_events.close());
}

BrowserWebSocket._(this._webSocket);
Expand Down

0 comments on commit a04d018

Please sign in to comment.