Skip to content

Commit

Permalink
Call the connectors API only when the rule has actions
Browse files Browse the repository at this point in the history
  • Loading branch information
fkanout committed Jun 8, 2022
1 parent 3f948cc commit f112bca
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ export function useFetchRuleActionConnectors({

const fetchRuleActionConnectors = useCallback(async () => {
try {
if (!ruleActions || ruleActions.length <= 0) {
setActionConnector((oldState: FetchActionConnectors) => ({
...oldState,
isLoadingActionConnectors: false,
actionConnectors: [],
}));
return;
}
const allActions = await loadAllActions({
http,
});
Expand Down

0 comments on commit f112bca

Please sign in to comment.