Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

708 - fix console warning in disable connections #750

Merged
merged 3 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The types of changes are:

### Fixed
* Make reading of environment variables case insensitive [712](https://github.com/ethyca/fidesops/pull/712)
* Fix console warning in disable connection modal [750](https://github.com/ethyca/fidesops/pull/750)


## [1.6.0](https://github.com/ethyca/fidesops/compare/1.5.3...1.6.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ const DisableConnectionModal: React.FC<DataConnectionProps> = ({

const handleDisableConnection = async () => {
const shouldDisable = !disabled;
return patchConnection({
patchConnection({
key: connection_key,
name,
disabled: shouldDisable,
access: access_type,
connection_type,
})
.unwrap()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the modal still close once the request finishes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, it still closes automatically once the request completes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great. So was the issue was calling the onClose function after the modal had closed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bravo @eastandwestwind! good find

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that onClose was the issue. I suspect something to do with the component possibly being unmounted by the time onClose is called

.then(() => onClose());
});
};

const closeIfComplete = () => {
Expand Down