Skip to content

Commit

Permalink
fix(view): remove not broadly supported ECMA Script features in the f…
Browse files Browse the repository at this point in the history
…rontend
  • Loading branch information
MauriceNino committed Apr 29, 2023
1 parent 82b8f6d commit 5ba5ed2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion apps/view/src/widgets/cpu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ export const CpuChart: FC<CpuChartProps> = ({
textLeft={
multiView || !showPercentages
? undefined
: `%: ${((chart.at(-1)?.y as number) ?? 0)?.toFixed(1)}`
: `%: ${((chart[chart.length - 1]?.y as number) ?? 0)?.toFixed(
1
)}`
}
textRight={
config.enable_cpu_temps && !multiView && chart.length > 1
Expand Down
10 changes: 6 additions & 4 deletions apps/view/src/widgets/gpu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export const GpuChart: FC<GpuChartProps> = ({
contentLoaded={chartDataLoad.length > 1}
textLeft={
showPercentages
? `%: ${(chartDataLoad.at(-1)?.y as number)?.toFixed(1)} (Load)`
? `%: ${(
chartDataLoad[chartDataLoad.length - 1]?.y as number
)?.toFixed(1)} (Load)`
: undefined
}
textOffset={textOffset}
Expand All @@ -66,9 +68,9 @@ export const GpuChart: FC<GpuChartProps> = ({

<ChartContainer
contentLoaded={chartDataMemory.length > 1}
textLeft={`%: ${(chartDataMemory.at(-1)?.y as number)?.toFixed(
1
)} (Memory)`}
textLeft={`%: ${(
chartDataMemory[chartDataMemory.length - 1]?.y as number
)?.toFixed(1)} (Memory)`}
textOffset={textOffset}
textSize={textSize}
renderChart={size => (
Expand Down

0 comments on commit 5ba5ed2

Please sign in to comment.