mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 17:45:22 +00:00
hub: fix missed notification when connecting
This fixes the first notification being missed due to the notification handler not being started until after notifications are enabled. It also fixes the DidConnect action changing the state to Unknown after a notification was received that set the state to a known value.
This commit is contained in:
@@ -49,8 +49,6 @@ const runtime: Reducer<HubRuntimeState, Action> = (
|
||||
switch (action.type) {
|
||||
case BleDeviceActionType.DidDisconnect:
|
||||
return HubRuntimeState.Disconnected;
|
||||
case BleDeviceActionType.DidConnect:
|
||||
return HubRuntimeState.Unknown;
|
||||
case HubMessageActionType.RuntimeStatus:
|
||||
switch (action.newStatus) {
|
||||
case HubRuntimeStatusType.Idle:
|
||||
|
||||
Reference in New Issue
Block a user