Skip to content

Commit ba99545

Browse files
committed
fix chart income
1 parent 71b5748 commit ba99545

File tree

1 file changed

+5
-8
lines changed
  • src/features/Overview/SlotPerformance/ComputeUnitsCard

1 file changed

+5
-8
lines changed

src/features/Overview/SlotPerformance/ComputeUnitsCard/Chart.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ function getChartData(computeUnits: ComputeUnits): ChartData[] {
104104
computeUnits.txn_compute_units_consumed[txn_idx]
105105
: 0;
106106
const priority_fee =
107-
!event.start &&
108-
computeUnits.txn_landed[txn_idx] &&
109-
computeUnits.txn_error_code[txn_idx] === 0
107+
!event.start && computeUnits.txn_landed[txn_idx]
110108
? Number(computeUnits.txn_priority_fee[txn_idx])
111109
: 0;
112110
const tip =
@@ -419,8 +417,8 @@ export default function Chart({
419417
);
420418

421419
const maxIncomeValue = Math.max(
422-
data.reduce((sum, d) => sum + d.tips_lamports, 0),
423-
data.reduce((sum, d) => sum + d.priority_fees_lamports, 0),
420+
data[data.length - 1].priority_fees_lamports,
421+
data[data.length - 1].tips_lamports,
424422
12_000_000,
425423
);
426424
const defaultIncomeTicks = useMemo(
@@ -1054,12 +1052,11 @@ export default function Chart({
10541052
type="number"
10551053
domain={["auto", "dataMax + 250000"]}
10561054
ticks={defaultIncomeTicks}
1055+
unit=" ꜱᴏʟ"
10571056
orientation="right"
10581057
tickFormatter={(tick) => {
10591058
if (typeof tick !== "number") return "";
1060-
return (
1061-
(tick / 1_000_000_000).toFixed(3).padEnd(3, "0") + " ꜱᴏʟ"
1062-
);
1059+
return (tick / 1_000_000_000).toFixed(3).padEnd(3, "0");
10631060
}}
10641061
/>
10651062

0 commit comments

Comments
 (0)