Load current user after loading client config (#6648)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
964077eba3
Коммит
bf12e7e32c
@@ -33,24 +33,16 @@ import {savePreferences, deletePreferences} from 'mattermost-redux/actions/prefe
|
||||
|
||||
import {Preferences as PreferencesRedux} from 'mattermost-redux/constants';
|
||||
|
||||
export function loadMe(callback) {
|
||||
UserActions.loadMe()(dispatch, getState).then(
|
||||
() => {
|
||||
export function loadMe() {
|
||||
return UserActions.loadMe()(dispatch, getState).then(() => {
|
||||
if (window.mm_config) {
|
||||
loadCurrentLocale();
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
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;
|
||||
|
||||
if (global.window && global.window.analytics) {
|
||||
@@ -69,19 +61,14 @@ export function loadMeAndConfig(callback) {
|
||||
});
|
||||
}
|
||||
|
||||
loadCurrentLocale();
|
||||
|
||||
Promise.all([
|
||||
loadMe(),
|
||||
getLicenseConfig()(store.dispatch, store.getState).then(
|
||||
(license) => { // eslint-disable-line max-nested-callbacks
|
||||
(license) => {
|
||||
global.window.mm_license = license;
|
||||
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
)
|
||||
]).then(callback);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user