fix: dataset exists error in save Dataset modal (#21244)

* dataset exists error

* fixed flashing modal
This commit is contained in:
AAfghahi 2022-08-31 16:47:39 -04:00 committed by GitHub
parent 9c4ae2ab7e
commit a7fe4850ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -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'),

View File

@ -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) => {