From 5389c8980df7b68f730a905eda206b02c8aefdad Mon Sep 17 00:00:00 2001 From: Santiago Morel Berni Date: Thu, 25 Jun 2026 17:37:25 -0500 Subject: [PATCH] fix: sync state.device when ACTION_UPDATE_DEVICE fires When a device name is changed, ACTION_UPDATE_DEVICE updates state.devices[] but left state.device stale. Components reading state.device (DeviceInfo, CommacareBadge) would not re-render until remount, making the name change appear to have no effect. Co-Authored-By: Claude Sonnet 4.6 --- src/reducers/globalState.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/reducers/globalState.js b/src/reducers/globalState.js index 389bb2f7..2994d9e3 100644 --- a/src/reducers/globalState.js +++ b/src/reducers/globalState.js @@ -134,6 +134,9 @@ export default function reducer(_state, action) { } else { state.devices.unshift(populateFetchedAt(action.device)); } + if (state.dongleId && action.device.dongle_id === state.dongleId) { + state.device = populateFetchedAt(action.device); + } break; case Types.ACTION_UPDATE_ROUTE: if (state.routes) {