refactor: move abort controller into useLazyApps hook

This commit is contained in:
Rıdvan Akca
2024-03-11 16:16:12 +03:00
parent 2ee5af8bfb
commit 5835def5d0
7 changed files with 47 additions and 38 deletions

View File

@@ -79,11 +79,17 @@ function ExecutionStep(props) {
const isTrigger = step.type === 'trigger';
const isAction = step.type === 'action';
const formatMessage = useFormatMessage();
const useAppsOptions = {};
const { data: apps } = useApps({
onlyWithTriggers: isTrigger,
onlyWithActions: isAction,
});
if (isTrigger) {
useAppsOptions.onlyWithTriggers = true;
}
if (isAction) {
useAppsOptions.onlyWithActions = true;
}
const { data: apps } = useApps(useAppsOptions);
const app = apps?.data?.find((currentApp) => currentApp.key === step.appKey);