Skip to content

Commit

Permalink
BUGFIX: Don’t show same error message twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebobo committed Nov 4, 2024
1 parent b7b4ca8 commit 6646240
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ const CreateAssetCollectionDialog = () => {
.then(() => {
Notify.ok(translate('assetCollectionActions.create.success', 'Asset collection was created'));
})
.catch((error) => {
Notify.error(
translate('assetCollectionActions.create.error', 'Failed to create asset collection'),
error.message
);
.catch(() => {
return;
});
}, [setDialogVisible, createAssetCollection, title, selectedAssetCollection?.id, Notify, translate]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ const DeleteButton: React.FC = () => {
);
setSelectedAssetCollectionAndTag({ tagId: null, assetCollectionId: null });
})
.catch((error) => {
Notify.error(
translate('assetCollectionActions.delete.error', 'Failed to delete asset collection'),
error.message
);
.catch(() => {
return;
});
}
}, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const CreateTagDialog: React.FC = () => {
.then(() => {
Notify.ok(translate('tagActions.create.success', 'Tag was created'));
})
.catch((error) => {
Notify.error(translate('tagActions.create.error', 'Failed to create tag'), error.message);
.catch(() => {
return;
});
}, [Notify, setDialogState, createTag, dialogState, translate, selectedAssetCollection]);
const setLabel = useCallback((label) => setDialogState((state) => ({ ...state, label })), [setDialogState]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const NewAssetDialog: React.FC = () => {
void refetch();
}
})
.catch((error) => {
Notify.error(translate('fileUpload.error', 'Upload failed'), error);
.catch(() => {
return;
});
}, [uploadFiles, dialogState.files.selected, setFiles, Notify, translate, refetch]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const AssetActions: React.FC<ItemActionsProps> = ({ asset }: ItemActionsProps) =
.then(() => {
Notify.ok(translate('assetActions.import.success', 'Asset was successfully imported'));
})
.catch((error) => {
Notify.error(translate('assetActions.import.error', 'Failed to import asset'), error.message);
.catch(() => {
return;
});
}, [importAsset, asset, Notify, translate]);

Expand Down

0 comments on commit 6646240

Please sign in to comment.