From 04b5e6ed9e71148957b7d8563c3509e1b1722e74 Mon Sep 17 00:00:00 2001 From: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com> Date: Tue, 17 Jan 2023 11:16:54 +0100 Subject: [PATCH] Alerting: Fix group select not being filled by selected folder when creating alert from panel (#61577) Add fetchRulerRulesIfNotFetchedYet fetching when results are an empty object --- public/app/features/alerting/unified/state/actions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/features/alerting/unified/state/actions.ts b/public/app/features/alerting/unified/state/actions.ts index 6daa4946ba1..c9efd56ddab 100644 --- a/public/app/features/alerting/unified/state/actions.ts +++ b/public/app/features/alerting/unified/state/actions.ts @@ -258,7 +258,8 @@ export function fetchRulerRulesIfNotFetchedYet(rulesSourceName: string): ThunkRe return (dispatch, getStore) => { const { rulerRules } = getStore().unifiedAlerting; const resp = rulerRules[rulesSourceName]; - if (!resp?.result && !(resp && isRulerNotSupportedResponse(resp)) && !resp?.loading) { + const emptyResults = isEmpty(resp?.result); + if (emptyResults && !(resp && isRulerNotSupportedResponse(resp)) && !resp?.loading) { dispatch(fetchRulerRulesAction({ rulesSourceName })); } };