Commit f9def19 1 parent d4bf5df commit f9def19 Copy full SHA for f9def19
File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ final class _ConnectionCallbacks {
273
273
String get attemptIdString => attempt.idAsString;
274
274
final SocketConnectionManager manager;
275
275
276
- WebSocketConnectionState lastState = const WebSocketReady ._() ;
276
+ WebSocketConnectionState ? lastState;
277
277
278
278
void onMessage (String message) {
279
279
if (attempt != manager._currentAttempt) {
@@ -347,8 +347,13 @@ final class _ConnectionCallbacks {
347
347
manager._onStateChange (newState);
348
348
}
349
349
350
- bool _isTransitionAllowed (lastState, newState) {
350
+ bool _isTransitionAllowed (
351
+ WebSocketConnectionState ? lastState,
352
+ WebSocketConnectionState newState,
353
+ ) {
351
354
switch ((lastState, newState)) {
355
+ case (null , _):
356
+ return true ;
352
357
case (final a, final b) when a == b:
353
358
case (_, WebSocketInitializing ()):
354
359
case (WebSocketClosed (), _):
You can’t perform that action at this time.
0 commit comments