fix(editor): use const for nextZones in lateral picker callback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bastien ChanotandClaude Opus 4.6 committed 2026-05-23 22:23:58 +02:00
1 parent 93503b7ce5
commit c4ab6f60e4
1 file changed
+17 -17
+17 -17
View File
@@ -483,24 +483,24 @@ export default function EditorRoute() {
setLateralTarget(null) setLateralTarget(null)
return return
} }
let nextZones = [...fresh.zones] const newSideZones = sides
for (const side of sides) { .filter(
const exists = nextZones.some( (side) =>
(z) => !fresh.zones.some(
z.boneId === lateralTarget.boneId && (z) =>
z.detailSourceId === lateralTarget.detailSourceId && z.boneId === lateralTarget.boneId &&
z.side === side, z.detailSourceId === lateralTarget.detailSourceId &&
z.side === side,
),
) )
if (!exists) { .map((side) => ({
nextZones.push({ boneId: lateralTarget.boneId,
boneId: lateralTarget.boneId, ...(lateralTarget.detailSourceId
...(lateralTarget.detailSourceId ? { detailSourceId: lateralTarget.detailSourceId }
? { detailSourceId: lateralTarget.detailSourceId } : {}),
: {}), side,
side, }))
}) const nextZones = [...fresh.zones, ...newSideZones]
}
}
updateObservation(activeIndex, { ...fresh, zones: nextZones }) updateObservation(activeIndex, { ...fresh, zones: nextZones })
setLateralTarget(null) setLateralTarget(null)
}} }}