Skip to content

Commit a343aef

Browse files
talissoncostaclaude
andcommitted
fix(diff): correct array concatenation in getVariationDiff
Fix operator precedence issue where || had higher precedence than concat, causing the array to not be properly concatenated. Wrap the left operand in parentheses to ensure correct evaluation order. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4af571b commit a343aef

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

frontend/web/components/diff/diff-utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ export const getVariationDiff = (
167167
) => {
168168
let totalChanges = 0
169169
const variationOptions = uniqBy(
170-
oldFeatureState?.multivariate_feature_state_values ||
171-
[].concat(newFeatureState?.multivariate_feature_state_values || []),
170+
(oldFeatureState?.multivariate_feature_state_values || []).concat(
171+
newFeatureState?.multivariate_feature_state_values || [],
172+
),
172173
(v) => v.multivariate_feature_option,
173174
)
174175
const diffs = variationOptions.map((variationOption) => {

0 commit comments

Comments
 (0)