Merge pull request #5335 from johnlim/master

Fixes #5188 "Failed to fetch the event types list due the error: API …
This commit is contained in:
Philipp Muens 2019-03-22 09:42:05 +01:00 committed by GitHub
commit 660804d4a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -334,12 +334,9 @@ class Utils {
const userConfig = configUtils.getConfig();
const currentId = userConfig.userId;
const globalConfig = configUtils.getGlobalConfig();
if (globalConfig.users && globalConfig.users[currentId] &&
globalConfig.users[currentId].dashboard &&
globalConfig.users[currentId].dashboard.accessKey) {
return globalConfig.users[currentId].dashboard.accessKey;
}
return false;
const username = _.get(globalConfig, `users[${currentId}].dashboard.username`);
return _.get(globalConfig, `users[${currentId}].dashboard.accessKey`, false) ||
_.get(globalConfig, `users[${currentId}].dashboard.accessKeys[${username}]`, false);
}
}