diff --git a/client/coral-embed-stream/src/tabs/configure/containers/AssetStatusInfo.js b/client/coral-embed-stream/src/tabs/configure/containers/AssetStatusInfo.js index ed0746d29..db74beff6 100644 --- a/client/coral-embed-stream/src/tabs/configure/containers/AssetStatusInfo.js +++ b/client/coral-embed-stream/src/tabs/configure/containers/AssetStatusInfo.js @@ -7,6 +7,7 @@ import { withUpdateAssetStatus, withCloseAsset, } from 'coral-framework/graphql/mutations'; +import { notifyOnMutationError } from 'coral-framework/hocs'; class AssetStatusInfoContainer extends React.Component { openAsset = () => @@ -45,7 +46,8 @@ const withAssetStatusInfoFragments = withFragments({ const enhance = compose( withAssetStatusInfoFragments, withUpdateAssetStatus, - withCloseAsset + withCloseAsset, + notifyOnMutationError(['updateAssetStatus', 'closeAsset']) ); export default enhance(AssetStatusInfoContainer); diff --git a/client/coral-embed-stream/src/tabs/configure/containers/Configure.js b/client/coral-embed-stream/src/tabs/configure/containers/Configure.js index c408d67fc..b6104b067 100644 --- a/client/coral-embed-stream/src/tabs/configure/containers/Configure.js +++ b/client/coral-embed-stream/src/tabs/configure/containers/Configure.js @@ -9,6 +9,10 @@ import { getDefinitionName } from 'coral-framework/utils'; class ConfigureContainer extends React.Component { render() { + if (this.props.data.error) { + return
{this.props.data.error.message}
; + } + return ( { - try { - await this.props.updateAssetSettings( - this.props.asset.id, - this.props.pending - ); - this.props.clearPending(); - } catch (err) { - this.props.notify('error', getErrorMessages(err)); - } + await this.props.updateAssetSettings( + this.props.asset.id, + this.props.pending + ); + this.props.clearPending(); }; render() { @@ -98,7 +91,6 @@ SettingsContainer.propTypes = { mergedSettings: PropTypes.object.isRequired, updateAssetSettings: PropTypes.func.isRequired, clearPending: PropTypes.func.isRequired, - notify: PropTypes.func.isRequired, updatePending: PropTypes.func.isRequired, canSave: PropTypes.bool.isRequired, }; @@ -135,7 +127,6 @@ const mapStateToProps = state => ({ const mapDispatchToProps = dispatch => bindActionCreators( { - notify, clearPending, updatePending, }, @@ -145,6 +136,7 @@ const mapDispatchToProps = dispatch => const enhance = compose( withSettingsFragments, withUpdateAssetSettings, + notifyOnMutationError(['updateAssetSettings']), connect(mapStateToProps, mapDispatchToProps), withMergedSettings('asset.settings', 'pending', 'mergedSettings') );