Skip to content

Commit

Permalink
Updated logic
Browse files Browse the repository at this point in the history
  • Loading branch information
alitoshmatov committed Jul 11, 2023
1 parent 4f1611f commit 5699cf8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,14 @@ function addSMSDomainIfPhoneNumber(login) {
* @returns {Object}
*/
function getAvatarsForAccountIDs(accountIDs, personalDetails, defaultValues = {}) {
const reversedDefaultValues = {};
_.map(Object.entries(defaultValues), (item) => {
reversedDefaultValues[item[1]] = item[0];
});

return _.map(accountIDs, (accountID) => {
const defaultData = _.find(defaultValues, (item) => item === accountID);
const userPersonalDetail = lodashGet(personalDetails, accountID, {login: lodashGet(defaultData, 'login', ''), accountID, avatar: ''});
const login = lodashGet(reversedDefaultValues, accountID, '');
const userPersonalDetail = lodashGet(personalDetails, accountID, {login, accountID, avatar: ''});
return {
id: accountID,
source: UserUtils.getAvatar(userPersonalDetail.avatar, userPersonalDetail.accountID),
Expand Down

0 comments on commit 5699cf8

Please sign in to comment.