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
This commit is contained in:
Sonia Aguilar 2023-01-17 11:16:54 +01:00 committed by GitHub
parent 9a8c798bae
commit 04b5e6ed9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 }));
}
};