Load current user after loading client config (#6648)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
964077eba3
Коммит
bf12e7e32c
@@ -33,55 +33,42 @@ 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(
|
global.window.mm_config = config;
|
||||||
(config) => {
|
|
||||||
global.window.mm_config = config;
|
|
||||||
|
|
||||||
if (global.window && global.window.analytics) {
|
if (global.window && global.window.analytics) {
|
||||||
global.window.analytics.identify(global.window.mm_config.DiagnosticId, {}, {
|
global.window.analytics.identify(global.window.mm_config.DiagnosticId, {}, {
|
||||||
context: {
|
context: {
|
||||||
ip: '0.0.0.0'
|
ip: '0.0.0.0'
|
||||||
},
|
},
|
||||||
page: {
|
page: {
|
||||||
path: '',
|
path: '',
|
||||||
referrer: '',
|
referrer: '',
|
||||||
search: '',
|
search: '',
|
||||||
title: '',
|
title: '',
|
||||||
url: ''
|
url: ''
|
||||||
},
|
},
|
||||||
anonymousId: '00000000000000000000000000'
|
anonymousId: '00000000000000000000000000'
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Promise.all([
|
||||||
|
loadMe(),
|
||||||
|
getLicenseConfig()(store.dispatch, store.getState).then(
|
||||||
|
(license) => {
|
||||||
|
global.window.mm_license = license;
|
||||||
}
|
}
|
||||||
|
)
|
||||||
loadCurrentLocale();
|
]).then(callback);
|
||||||
|
|
||||||
getLicenseConfig()(store.dispatch, store.getState).then(
|
|
||||||
(license) => { // eslint-disable-line max-nested-callbacks
|
|
||||||
global.window.mm_license = license;
|
|
||||||
|
|
||||||
if (callback) {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user