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:
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 {
|
||||
|
||||
Reference in new issue
Block a user