Unverified Commit c2eaa66d authored by Christopher Speller's avatar Christopher Speller
Browse files

MM-13177 Announcement bar fixes. (#2091)

Announcement bar fixes.
parent 88cc414f
......@@ -3,21 +3,17 @@
import * as PostActions from 'mattermost-redux/actions/posts';
import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
import {ActionTypes} from 'utils/constants.jsx';
import {logError} from 'mattermost-redux/actions/errors';
import {ActionTypes, AnnouncementBarTypes} from 'utils/constants.jsx';
export function editPost(post) {
return async (dispatch, getState) => {
const result = await PostActions.editPost(post)(dispatch, getState);
if (result.error) {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_ERROR,
err: {
id: result.error.server_error_id,
...result.error,
},
});
// Send to error bar if it's an edit post error about time limit.
if (result.error && result.error.server_error_id === 'api.post.update_post.permissions_time_limit.app_error') {
dispatch(logError({type: AnnouncementBarTypes.ANNOUNCEMENT, message: result.error.message}, true));
}
return result;
......
......@@ -105,11 +105,11 @@ export default class ConfigurationAnnouncementBar extends React.PureComponent {
}
}
if (!this.props.config.SendEmailNotifications === 'true' &&
if (this.props.config.SendEmailNotifications !== 'true' &&
this.props.config.EnablePreviewModeBanner === 'true') {
return (
<AnnouncementBar
type={AnnouncementBarTypes.CRITICAL}
type={AnnouncementBarTypes.ANNOUNCEMENT}
message={
<FormattedMessage
id={AnnouncementBarMessages.PREVIEW_MODE}
......@@ -169,7 +169,7 @@ export default class ConfigurationAnnouncementBar extends React.PureComponent {
if (this.props.user && !this.props.user.email_verified && this.props.config.RequireEmailVerification === 'true') {
return (
<AnnouncementBar
type={AnnouncementBarTypes.CRITICAL}
type={AnnouncementBarTypes.ANNOUNCEMENT}
message={
<React.Fragment>
<FormattedHTMLMessage
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment