Skip to content

Commit

Permalink
remove private field
Browse files Browse the repository at this point in the history
  • Loading branch information
ltdu committed Mar 3, 2019
1 parent 6277e44 commit 66496cc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/services/PeopleSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@ import { cloneDeep, findIndex } from "@microsoft/sp-lodash-subset";
export default class SPPeopleSearchService {
private cachedPersonas: { [property: string]: IUserInfo[] };
private cachedLocalUsers: { [siteUrl: string]: IUserInfo[] };
private absoluteWebUrl: string;

/**
* Service constructor
*/
constructor(private context: WebPartContext | ExtensionContext) {
this.cachedPersonas = {};
this.cachedLocalUsers = {};
this.absoluteWebUrl = this.context.pageContext.web.absoluteUrl;
this.cachedLocalUsers[this.absoluteWebUrl] = [];
this.cachedLocalUsers[this.context.pageContext.web.absoluteUrl] = [];
}

/**
Expand All @@ -31,7 +29,7 @@ export default class SPPeopleSearchService {
* @param value
*/
public generateUserPhotoLink(value: string): string {
return `${this.absoluteWebUrl}/_layouts/15/userphoto.aspx?accountname=${encodeURIComponent(value)}&size=M`;
return `${this.context.pageContext.web.absoluteUrl}/_layouts/15/userphoto.aspx?accountname=${encodeURIComponent(value)}&size=M`;
}

/**
Expand Down

0 comments on commit 66496cc

Please sign in to comment.