diff --git a/samples/react-groups-teams/src/webparts/microsoftGroups/components/MyTeams.tsx b/samples/react-groups-teams/src/webparts/microsoftGroups/components/MyTeams.tsx index 9232e061a..8e263ad76 100644 --- a/samples/react-groups-teams/src/webparts/microsoftGroups/components/MyTeams.tsx +++ b/samples/react-groups-teams/src/webparts/microsoftGroups/components/MyTeams.tsx @@ -30,7 +30,9 @@ export interface IMyTeamsState { TenantURL: String; } export default class MyTeams extends React.Component { - public Tenant = this.props.context.pageContext.web.absoluteUrl.split('.')[0].split('//')[1]; + public webAbsoluteURL: string = this.props.context.pageContext.web.absoluteUrl; + public TenantPathname: string = this.webAbsoluteURL.split('//')[1].split('/')[0]; + public TenantEmail: string = this.props.context.pageContext.user.loginName.split('@')[1]; private graphClient: MSGraphClient = null; constructor(props) { super(props); @@ -67,7 +69,7 @@ export default class MyTeams extends React.Component { ID = Items.id; }); - var URL = `https://tasks.office.com/${this.Tenant}.com/EN-US/Home/Planner#/plantaskboard?groupId=${GroupId.Id}&planId=${ID}`; + var URL = `https://tasks.office.com/${this.TenantEmail}/EN-US/Home/Planner#/plantaskboard?groupId=${GroupId.Id}&planId=${ID}`; var Planner = { Planner: URL }; var Results = Object.assign(GroupId, Planner); GroupId = Results; @@ -176,12 +178,12 @@ export default class MyTeams extends React.Component
{Team.Name}{Team.Description}
- + - + - +
@@ -197,4 +199,4 @@ export default class MyTeams extends React.Component
; } -} \ No newline at end of file +}