Skip to content

Commit 63e3682

Browse files
cursoragentarmenzg
andcommitted
Fix insight sorting by absolute savings
Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
1 parent b900add commit 63e3682

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

static/app/views/preprod/buildComparison/main/insightComparisonSection.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ export function InsightComparisonSection({
151151
}
152152

153153
for (const insights of Object.values(byTab)) {
154-
insights.sort((a, b) => b.total_savings_change - a.total_savings_change);
154+
insights.sort(
155+
(a, b) => Math.abs(b.total_savings_change) - Math.abs(a.total_savings_change)
156+
);
155157
}
156158

157159
return {

0 commit comments

Comments
 (0)