From 2fb509b98c0cd630e091f9ec33f1549e2aa29c21 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Mon, 1 Apr 2024 13:33:17 +0100 Subject: [PATCH] Refactor MonitorChart.tsx to improve readability and maintainability --- .../Monitor/MonitorCharts/MonitorChart.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dashboard/src/Components/Monitor/MonitorCharts/MonitorChart.tsx b/Dashboard/src/Components/Monitor/MonitorCharts/MonitorChart.tsx index 6449f97fc1..c23338fb8d 100644 --- a/Dashboard/src/Components/Monitor/MonitorCharts/MonitorChart.tsx +++ b/Dashboard/src/Components/Monitor/MonitorCharts/MonitorChart.tsx @@ -99,12 +99,14 @@ export class MonitorCharts { } if (data.miscData.probeId) { - const probe: Probe | undefined = data.probes.find((probe: Probe) => { - return ( - probe._id?.toString() === - data.miscData?.probeId?.toString() - ); - }); + const probe: Probe | undefined = data.probes.find( + (probe: Probe) => { + return ( + probe._id?.toString() === + data.miscData?.probeId?.toString() + ); + } + ); if (probe) { return probe.name || 'Probe';