Skip to content

Commit

Permalink
fix bug when disconnecting during recording
Browse files Browse the repository at this point in the history
  • Loading branch information
o-bagge committed Feb 4, 2024
1 parent 7234a11 commit 5e73173
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions open_earable/lib/apps/recorder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,12 @@ class _RecorderState extends State<Recorder> {

_setupListeners() {
_connectionStateSubscription =
_openEarable.bleManager.connectionStateStream.listen((_) {
setState(() {}); // rebuild page when connection state changes
_openEarable.bleManager.connectionStateStream.listen((connected) {
setState(() {
if (!connected) {
_recording = false;
}
});
});
_imuSubscription =
_openEarable.sensorManager.subscribeToSensorData(0).listen((data) {
Expand Down

0 comments on commit 5e73173

Please sign in to comment.