kgabryje commented on code in PR #21683:
URL: https://github.com/apache/superset/pull/21683#discussion_r985828109
##########
superset-frontend/src/views/CRUD/data/dataset/AddDatasetModal.tsx:
##########
@@ -100,9 +102,13 @@ const DatasetModal: FunctionComponent<DatasetModalProps> =
({
setDisableSave(true);
};
- const hide = () => {
- setItem(LocalStorageKeys.db, null);
+ const cleanup = () => {
clearModal();
+ setItem(LocalStorageKeys.db, null);
+ };
+
+ const hide = () => {
+ cleanup();
Review Comment:
I separated the cleanup functions from `onHide()`, because `onHide` does
`history.replace`, which causes race condition with `history.push` in line 131
--
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]