diegomedina248 commented on code in PR #19967:
URL: https://github.com/apache/superset/pull/19967#discussion_r889132238
##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx:
##########
@@ -503,7 +503,6 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps>
= ({
setImportingModal(false);
setPasswords({});
setConfirmedOverwrite(false);
- if (onDatabaseAdd) onDatabaseAdd();
Review Comment:
Yeah, sure.
Calling `onDatabaseAdd` in the `onClose` causes the callback to be fired
when it shouldn't.
The `onClose` is called, for instance, if you hit in the overlay.
That causes (in master) the following:
https://user-images.githubusercontent.com/17252075/171906617-319a39e7-647c-418d-bae6-8027a6e805fe.mov
The only places that should be called is when a change was actually made
(which was done already in almost all places, causing a double fetch/rerender).
The only place that uses this function is `DatabaseList`, which only does a
refresh.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]