Skip to content

Commit

Permalink
access personal details through map instead of find
Browse files Browse the repository at this point in the history
  • Loading branch information
TMisiukiewicz committed Aug 1, 2024
1 parent 3666caa commit b2cdfdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/PersonalDetailsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function getAccountIDsByLogins(logins: string[]): number[] {
*/
function getLoginsByAccountIDs(accountIDs: number[]): string[] {
return accountIDs.reduce((foundLogins: string[], accountID) => {
const currentDetail: Partial<PersonalDetails> = personalDetails.find((detail) => Number(detail?.accountID) === Number(accountID)) ?? {};
const currentDetail: Partial<PersonalDetails> = allPersonalDetails?.[accountID] ?? {};
if (currentDetail.login) {
foundLogins.push(currentDetail.login);
}
Expand Down

0 comments on commit b2cdfdb

Please sign in to comment.