Skip to content

Commit

Permalink
fix: dataset exists error in save Dataset modal (#21244)
Browse files Browse the repository at this point in the history
* dataset exists error

* fixed flashing modal
  • Loading branch information
AAfghahi authored Aug 31, 2022
1 parent 9c4ae2a commit a7fe485
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion superset-frontend/src/SqlLab/actions/sqlLab.js
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,10 @@ export function createDatasource(vizOptions) {

return Promise.resolve(json);
})
.catch(() => {
.catch(error => {
getClientErrorObject(error).then(e => {
dispatch(addDangerToast(e.error));
});
dispatch(
createDatasourceFailed(
t('An error occurred while creating the data source'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,12 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
[URL_PARAMS.formDataKey.name]: key,
});
createWindow(url);
setDatasetName(getDefaultDatasetName());
onHide();
})
.catch(() => {
addDangerToast(t('An error occurred saving dataset'));
});

setDatasetName(getDefaultDatasetName());
onHide();
};

const handleOverwriteDatasetOption = (value: SelectValue, option: any) => {
Expand Down

0 comments on commit a7fe485

Please sign in to comment.