Skip to content

Commit

Permalink
update: use if instead of switch case in xhr_transport.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
minoic authored and aran committed Dec 4, 2024
1 parent 101a46f commit a81f838
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/src/client/transport/xhr_transport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,12 @@ class XhrTransportStream implements GrpcTransportStream {
if (_incomingProcessor.isClosed) {
return;
}
switch (_request.readyState) {
case 2:
_onHeadersReceived();
break;
case 4:
_onRequestDone();
_close();
break;
// TODO: dart-lang/web#285 use 'if' for now
if (_request.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
_onHeadersReceived();
} else if (_request.readyState == XMLHttpRequest.DONE) {
_onRequestDone();
_close();
}
});

Expand Down

0 comments on commit a81f838

Please sign in to comment.