From fd6836e32614e3a64335c797e65c7167b49666d2 Mon Sep 17 00:00:00 2001 From: Matias Chomicki Date: Tue, 20 Jun 2023 16:39:48 +0200 Subject: [PATCH] Cloud rules: fix hardcoded conditional (#70387) --- .../features/alerting/unified/components/rules/CloudRules.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/features/alerting/unified/components/rules/CloudRules.tsx b/public/app/features/alerting/unified/components/rules/CloudRules.tsx index 7af1effd673..08e17437649 100644 --- a/public/app/features/alerting/unified/components/rules/CloudRules.tsx +++ b/public/app/features/alerting/unified/components/rules/CloudRules.tsx @@ -37,7 +37,7 @@ export const CloudRules = ({ namespaces, expandAll }: Props) => { [promRules, dsConfigs, rulesDataSources] ); - const hasSomeResults = rulesDataSources.some((ds) => promRules[ds.name]?.result?.length ?? 0 > 0); + const hasSomeResults = rulesDataSources.some((ds) => Boolean(promRules[ds.name]?.result?.length)); const hasDataSourcesConfigured = rulesDataSources.length > 0; const hasDataSourcesLoading = dataSourcesLoading.length > 0;