Load current user after loading client config (#6648)

Этот коммит содержится в:
Harrison Healey
2017-06-23 17:08:25 -04:00
коммит произвёл GitHub
родитель 964077eba3
Коммит bf12e7e32c

Просмотреть файл

@@ -33,24 +33,16 @@ import {savePreferences, deletePreferences} from 'mattermost-redux/actions/prefe
import {Preferences as PreferencesRedux} from 'mattermost-redux/constants'; import {Preferences as PreferencesRedux} from 'mattermost-redux/constants';
export function loadMe(callback) { export function loadMe() {
UserActions.loadMe()(dispatch, getState).then( return UserActions.loadMe()(dispatch, getState).then(() => {
() => {
if (window.mm_config) { if (window.mm_config) {
loadCurrentLocale(); loadCurrentLocale();
} }
});
if (callback) {
callback();
}
}
);
} }
export function loadMeAndConfig(callback) { export function loadMeAndConfig(callback) {
loadMe(() => { getClientConfig()(store.dispatch, store.getState).then((config) => {
getClientConfig()(store.dispatch, store.getState).then(
(config) => {
global.window.mm_config = config; global.window.mm_config = config;
if (global.window && global.window.analytics) { if (global.window && global.window.analytics) {
@@ -69,19 +61,14 @@ export function loadMeAndConfig(callback) {
}); });
} }
loadCurrentLocale(); Promise.all([
loadMe(),
getLicenseConfig()(store.dispatch, store.getState).then( getLicenseConfig()(store.dispatch, store.getState).then(
(license) => { // eslint-disable-line max-nested-callbacks (license) => {
global.window.mm_license = license; global.window.mm_license = license;
if (callback) {
callback();
} }
} )
); ]).then(callback);
}
);
}); });
} }