refactor(beszel): remove ternary operators and fix dead code

Replace all ternary operators with if/else, &&/||, or early returns.
Remove unused noAnimation constant that caused lint error.
Fix variable shadowing in tooltip deduplication loop.
This commit is contained in:
Thomas Camlong committed 2026-06-15 17:24:18 +02:00
1 parent 15ed1e51fd
commit df66cf25c7
6 files changed
+47 -31

No files matched your search

@@ -298,19 +298,21 @@ export class BeszelIntegration extends Integration {
created: new Date().toISOString(),
updated: new Date().toISOString(),
};
const containerStats: BeszelContainerStatsRecord | null =
let containerStats: BeszelContainerStatsRecord | null = null;
if (
parsed.container &&
Array.isArray(parsed.container) &&
(parsed.container as BeszelContainerStats[]).length > 0
? {
id: "",
system: systemId,
stats: parsed.container as BeszelContainerStats[],
type: "1m",
created: new Date().toISOString(),
updated: new Date().toISOString(),
}
: null;
) {
containerStats = {
id: "",
system: systemId,
stats: parsed.container as BeszelContainerStats[],
type: "1m",
created: new Date().toISOString(),
updated: new Date().toISOString(),
};
}
onMessage({ stats, containerStats });
}
} catch {