mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fix console error when logging in with non-english language (#4941)
This commit is contained in:
committed by
Corey Hulen
parent
2308499fa4
commit
fba49d1b80
@@ -190,15 +190,11 @@ export function emitPostFocusEvent(postId, onSuccess) {
|
||||
}
|
||||
|
||||
export function emitCloseRightHandSide() {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_SEARCH,
|
||||
results: null
|
||||
});
|
||||
SearchStore.storeSearchResults(null, false, false);
|
||||
SearchStore.emitSearchChange();
|
||||
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_POST_SELECTED,
|
||||
postId: null
|
||||
});
|
||||
PostStore.storeSelectedPostId(null);
|
||||
PostStore.emitSelectedPostChange(false, false);
|
||||
}
|
||||
|
||||
export function emitPostFocusRightHandSideFromSearch(post, isMentionSearch) {
|
||||
|
||||
@@ -162,12 +162,10 @@ export default class Client {
|
||||
|
||||
handleResponse(methodName, successCallback, errorCallback, err, res) {
|
||||
if (res && res.header) {
|
||||
this.serverVersion = res.header[HEADER_X_VERSION_ID];
|
||||
if (res.header[HEADER_X_VERSION_ID]) {
|
||||
this.serverVersion = res.header[HEADER_X_VERSION_ID];
|
||||
}
|
||||
|
||||
this.clusterId = res.header[HEADER_X_CLUSTER_ID];
|
||||
if (res.header[HEADER_X_CLUSTER_ID]) {
|
||||
this.clusterId = res.header[HEADER_X_CLUSTER_ID];
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ export default class Root extends React.Component {
|
||||
// Fastclick
|
||||
FastClick.attach(document.body);
|
||||
}
|
||||
|
||||
localizationChanged() {
|
||||
const locale = LocalizationStore.getLocale();
|
||||
|
||||
@@ -56,13 +57,16 @@ export default class Root extends React.Component {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps) {
|
||||
this.redirectIfNecessary(newProps);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
// Redirect if Necessary
|
||||
this.redirectIfNecessary(this.props);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// Setup localization listener
|
||||
LocalizationStore.addChangeListener(this.localizationChanged);
|
||||
@@ -70,9 +74,11 @@ export default class Root extends React.Component {
|
||||
// Get our localizaiton
|
||||
GlobalActions.loadDefaultLocale();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
LocalizationStore.removeChangeListener(this.localizationChanged);
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.translations == null || this.props.children == null) {
|
||||
return <div/>;
|
||||
|
||||
Reference in New Issue
Block a user