diff options
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/error_bar.jsx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/web/react/components/error_bar.jsx b/web/react/components/error_bar.jsx index 921e8afe1..e93545c25 100644 --- a/web/react/components/error_bar.jsx +++ b/web/react/components/error_bar.jsx @@ -13,6 +13,12 @@ export default class ErrorBar extends React.Component { this.state = ErrorStore.getLastError(); } + static propTypes() { + return { + intl: ReactIntl.intlShape.isRequired + }; + } + isValidError(s) { if (!s) { return false; @@ -41,6 +47,18 @@ export default class ErrorBar extends React.Component { return false; } + componentWillMount() { + if (global.window.mm_config.SendEmailNotifications === 'false') { + ErrorStore.storeLastError({message: this.props.intl.formatMessage( + { + id: 'error_bar.preview_mode', + defaultMessage: 'Preview Mode: Email notifications have not been configured' + } + )}); + this.onErrorChange(); + } + } + componentDidMount() { ErrorStore.addChangeListener(this.onErrorChange); } @@ -86,3 +104,5 @@ export default class ErrorBar extends React.Component { ); } } + +export default ReactIntl.injectIntl(ErrorBar); |