diff --git a/client/src/app-components/topic-edit-modal.js b/client/src/app-components/topic-edit-modal.js index 9f70a4a5..dfef57cb 100644 --- a/client/src/app-components/topic-edit-modal.js +++ b/client/src/app-components/topic-edit-modal.js @@ -11,6 +11,7 @@ import SubmitButton from 'core-components/submit-button'; import IconSelector from 'core-components/icon-selector'; import ColorSelector from 'core-components/color-selector'; import InfoTooltip from 'core-components/info-tooltip'; +import Message from 'core-components/message'; class TopicEditModal extends React.Component { @@ -26,7 +27,8 @@ class TopicEditModal extends React.Component { state = { values: this.props.defaultValues || {title: '', icon: 'address-card', color: '#ff6900', private: false}, - loading: false + loading: false, + errorMessage: false }; render() { @@ -34,6 +36,7 @@ class TopicEditModal extends React.Component {
+ {this.state.errorMessage ? {i18n(this.state.errorMessage)} : null} @@ -68,13 +71,16 @@ class TopicEditModal extends React.Component { } }).then(() => { this.context.closeModal(); - + this.setState({ + errorMessage: false + }); if(this.props.onChange) { this.props.onChange(); } - }).catch(() => { + }).catch((e) => { this.setState({ - loading: false + loading: false, + errorMessage: e.message }); }); }