Skip to content

Commit

Permalink
fix: Back Button on Create for DB conncetion (#15389)
Browse files Browse the repository at this point in the history
* fix: add icons (#15122)

* added alerts

* revisions

* added icon

* spinner

* fixing backButton on Create
  • Loading branch information
AAfghahi authored Jun 25, 2021
1 parent 7b5e468 commit 08318fc
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -596,18 +596,20 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
setEditNewDb(true);
};

const handleBackButtonOnConnect = () => {
if (editNewDb) {
setHasConnectedDb(false);
}
setDB({ type: ActionType.reset });
};

const renderModalFooter = () => {
if (db) {
// if db show back + connenct
if (!hasConnectedDb || editNewDb) {
return (
<>
<StyledFooterButton
key="back"
onClick={() => {
setDB({ type: ActionType.reset });
}}
>
<StyledFooterButton key="back" onClick={handleBackButtonOnConnect}>
Back
</StyledFooterButton>
<StyledFooterButton
Expand Down

0 comments on commit 08318fc

Please sign in to comment.