Skip to content

Commit 3007a38

Browse files
authored
Merge branch 'master' into nmetulev/typescleanup
2 parents 47eaa64 + 177aa22 commit 3007a38

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/mgt-login/mgt-login.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class MgtLogin extends MgtBaseComponent {
163163
*/
164164
protected async loadState() {
165165
const provider = Providers.globalProvider;
166-
if (provider) {
166+
if (provider && !this.userDetails) {
167167
if (provider.state === ProviderState.SignedIn) {
168168
const batch = provider.graph.forComponent(this).createBatch();
169169
batch.get('me', 'me', ['user.read']);

src/graph/graph.people.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { Contact, Person, User } from '@microsoft/microsoft-graph-types';
99
import { IGraph } from '../IGraph';
1010
import { prepScopes } from '../utils/GraphHelpers';
11+
import { IDynamicPerson } from './types';
1112

1213
/**
1314
* Person Type enum
@@ -104,7 +105,7 @@ export async function getPeopleFromGroup(graph: IGraph, groupId: string): Promis
104105
* returns a promise that resolves after specified time
105106
* @param time in milliseconds
106107
*/
107-
export function getEmailFromGraphEntity(entity: User | Person | Contact): string {
108+
export function getEmailFromGraphEntity(entity: IDynamicPerson): string {
108109
const person = entity as Person;
109110
const user = entity as User;
110111
const contact = entity as Contact;
@@ -116,7 +117,6 @@ export function getEmailFromGraphEntity(entity: User | Person | Contact): string
116117
} else if (contact.emailAddresses && contact.emailAddresses.length) {
117118
return contact.emailAddresses[0].address;
118119
}
119-
120120
return null;
121121
}
122122

0 commit comments

Comments
 (0)