Refactor MonitorChart.tsx to improve readability and maintainability

This commit is contained in:
Simon Larsen 2024-04-01 13:33:17 +01:00
parent 39c7f6f2ba
commit 2fb509b98c
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE

View File

@ -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';