diff --git a/src/app/components/results/LoadoutComparison.tsx b/src/app/components/results/LoadoutComparison.tsx index 6108c1c6..53fd3714 100644 --- a/src/app/components/results/LoadoutComparison.tsx +++ b/src/app/components/results/LoadoutComparison.tsx @@ -316,7 +316,7 @@ const LoadoutComparison: React.FC = observer(() => { const entry: typeof lines[0] = { name: input.xValue }; for (const [i, l] of input.loadouts.entries()) { const v = getOutput(y, l, input.monster); - entry[`Loadout ${i + 1}`] = v.toFixed(2); + entry[l.name] = v.toFixed(2); maximum = Math.max(maximum, v); min = Math.min(min, v); } @@ -348,7 +348,7 @@ const LoadoutComparison: React.FC = observer(() => { lines.push( { const store = useStore(); const { showTtkComparison } = store.prefs; const calcResults = toJS(store.calc.loadouts); + const loadouts = toJS(store.loadouts); const { resolvedTheme } = useTheme(); const isDark = resolvedTheme === 'dark'; @@ -103,12 +104,12 @@ const TtkComparison: React.FC = observer(() => { if (v) { runningTotals[i] = (runningTotals[i] || 0) + v; } - entry[`Loadout ${i + 1}`] = (runningTotals[i] * 100).toFixed(2); + entry[loadouts[i].name] = (runningTotals[i] * 100).toFixed(2); }); lines.push(entry); } return lines; - }, [xAxisType, calcResults]); + }, [xAxisType, calcResults, loadouts]); const generateLines = useCallback(() => { const lines: React.ReactNode[] = []; @@ -118,11 +119,11 @@ const TtkComparison: React.FC = observer(() => { : ['blue', 'chocolate', 'green', 'sienna', 'purple']; for (let i = 0; i < calcResults.length; i++) { const colour = strokeColours.shift() || 'red'; - lines.push(); + lines.push(); strokeColours.push(colour); } return lines; - }, [isDark, calcResults.length]); + }, [isDark, calcResults.length, loadouts]); return (