Skip to content

Commit

Permalink
Update chart_connection.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c committed May 1, 2024
1 parent fea1d0c commit b255be6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class ChartConnection extends DisposableController
void _stopConnection() {
_polling?.cancel();
_polling = null;
// We use state to declare disconnection.
// We cannot use nullness of _polling to check disconnection, because there is async gap in
// `maybeInitialize` when state is already initialized, but _polling is still null.
state = ChartConnectionState.stopped;
}

Expand Down

0 comments on commit b255be6

Please sign in to comment.