diff --git a/packages/web/src/components/pages/Executors/ExecutorsList/AddExecutorsModal.tsx b/packages/web/src/components/pages/Executors/ExecutorsList/AddExecutorsModal.tsx index 8fe762add..36b81e7ad 100644 --- a/packages/web/src/components/pages/Executors/ExecutorsList/AddExecutorsModal.tsx +++ b/packages/web/src/components/pages/Executors/ExecutorsList/AddExecutorsModal.tsx @@ -55,16 +55,16 @@ const AddExecutorsModal: React.FC = () => { createExecutor(body) .then(displayDefaultNotificationFlow) - .then(res => openDetails(res.data.metadata.name)) + .then(res => { + openDetails(res.data.metadata.name); + close(); + }) .catch(err => { setError(err); if (!inTopInViewport && topRef && topRef.current) { topRef.current.scrollIntoView(); } - }) - .finally(() => { - close(); }); }; diff --git a/packages/web/src/components/pages/Sources/SourcesList/AddSourceModal.tsx b/packages/web/src/components/pages/Sources/SourcesList/AddSourceModal.tsx index 249d6d45e..f874b3504 100644 --- a/packages/web/src/components/pages/Sources/SourcesList/AddSourceModal.tsx +++ b/packages/web/src/components/pages/Sources/SourcesList/AddSourceModal.tsx @@ -61,16 +61,16 @@ const AddSourceModal: React.FC = () => { createSource(body) .then(displayDefaultNotificationFlow) - .then(res => openDetails(res.data.metadata.name)) + .then(res => { + openDetails(res.data.metadata.name); + close(); + }) .catch(err => { setError(err); if (!inTopInViewport && topRef && topRef.current) { topRef.current.scrollIntoView(); } - }) - .finally(() => { - close(); }); }; diff --git a/packages/web/src/components/pages/Triggers/TriggersList/AddTriggerModal/AddTriggerModal.tsx b/packages/web/src/components/pages/Triggers/TriggersList/AddTriggerModal/AddTriggerModal.tsx index a81661cc0..c2c587ff5 100644 --- a/packages/web/src/components/pages/Triggers/TriggersList/AddTriggerModal/AddTriggerModal.tsx +++ b/packages/web/src/components/pages/Triggers/TriggersList/AddTriggerModal/AddTriggerModal.tsx @@ -82,16 +82,16 @@ const AddTriggerModal: React.FC = () => { }; createTrigger(body) .then(displayDefaultNotificationFlow) - .then(res => openDetails(res.data.name)) + .then(res => { + openDetails(res.data.name); + close(); + }) .catch(err => { setError(err); if (!inTopInViewport && topRef && topRef.current) { topRef.current.scrollIntoView(); } - }) - .finally(() => { - close(); }); };