fix: variable shadowing silently drops object label updates

When an existing tracked object's label or stationary status changes
(e.g. sub_label assignment from face recognition), the update handler
declares a new const newObjects that shadows the outer let newObjects.

The label and stationary mutations apply to the inner copy, but
handleSetObjects on line 148 reads the outer variable which was never
mutated. The update is silently discarded.

Remove the inner declaration so mutations apply to the outer variable
that gets passed to handleSetObjects.
This commit is contained in:
ryzendigo 2026-03-16 14:42:45 +08:00
parent 5a214eb0d1
commit d0aae8789a

View File

@ -125,8 +125,6 @@ export function useCameraActivity(
newObjects = [...(objects ?? []), newActiveObject];
}
} else {
const newObjects = [...(objects ?? [])];
let label = updatedEvent.after.label;
if (updatedEvent.after.sub_label) {