Skip to content

Commit 5079899

Browse files
authored
Merge pull request #646 from juhaalhojoki/fix/peopleSearchService-imageUrl
Fix/people search service profile picture image url
2 parents b3e253d + d201206 commit 5079899

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/services/PeopleSearchService.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,12 @@ export default class SPPeopleSearchService {
228228
const userResults = values.map(element => {
229229
switch (element.EntityType) {
230230
case 'User':
231-
let email: string = element.EntityData.Email !== null ? element.EntityData.Email : element.Description;
231+
const accountName: string = element.Description || "";
232+
const email: string = element.EntityData.Email || element.Description;
232233
return {
233234
id: element.Key,
234235
loginName: element.LoginName ? element.LoginName : element.Key,
235-
imageUrl: this.generateUserPhotoLink(email),
236+
imageUrl: this.generateUserPhotoLink(accountName),
236237
imageInitials: this.getFullNameInitials(element.DisplayText),
237238
text: element.DisplayText, // name
238239
secondaryText: email, // email

0 commit comments

Comments
 (0)