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)
return
}
let nextZones = [...fresh.zones]
for (const side of sides) {
const exists = nextZones.some(
(z) =>
z.boneId === lateralTarget.boneId &&
z.detailSourceId === lateralTarget.detailSourceId &&
z.side === side,
const newSideZones = sides
.filter(
(side) =>
!fresh.zones.some(
(z) =>
z.boneId === lateralTarget.boneId &&
z.detailSourceId === lateralTarget.detailSourceId &&
z.side === side,
),
)
if (!exists) {
nextZones.push({
boneId: lateralTarget.boneId,
...(lateralTarget.detailSourceId
? { detailSourceId: lateralTarget.detailSourceId }
: {}),
side,
})
}
}
.map((side) => ({
boneId: lateralTarget.boneId,
...(lateralTarget.detailSourceId
? { detailSourceId: lateralTarget.detailSourceId }
: {}),
side,
}))
const nextZones = [...fresh.zones, ...newSideZones]
updateObservation(activeIndex, { ...fresh, zones: nextZones })
setLateralTarget(null)
}}