Skip to content

Commit

Permalink
fix: show modal error instead of closing modal
Browse files Browse the repository at this point in the history
  • Loading branch information
topliceanurazvan committed Nov 16, 2023
1 parent 8a08675 commit 63ac1a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
};

Expand Down

0 comments on commit 63ac1a9

Please sign in to comment.