Skip to content

Commit dff3961

Browse files
Fixed issue where presence was not getting cleared (#422)
Co-authored-by: Shane Weaver <[email protected]>
1 parent 0963e89 commit dff3961

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/components/mgt-person-card/mgt-person-card.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,19 @@ export class MgtPersonCard extends MgtTemplatedComponent {
7878
attribute: 'person-details',
7979
type: Object
8080
})
81-
public personDetails: IDynamicPerson;
81+
public get personDetails(): IDynamicPerson {
82+
return this._personDetails;
83+
}
84+
public set personDetails(value: IDynamicPerson) {
85+
if (this._personDetails === value) {
86+
return;
87+
}
88+
89+
this._personDetails = value;
90+
91+
this.requestStateUpdate();
92+
this.requestUpdate('personDetails');
93+
}
8294

8395
/**
8496
* Set the image of the person
@@ -153,6 +165,8 @@ export class MgtPersonCard extends MgtTemplatedComponent {
153165
})
154166
public personPresence: MicrosoftGraphBeta.Presence;
155167

168+
private _personDetails: IDynamicPerson;
169+
156170
/**
157171
* Invoked each time the custom element is appended into a document-connected element
158172
*

src/components/mgt-person/mgt-person.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ export class MgtPerson extends MgtTemplatedComponent {
143143
this.personImage = null;
144144
}
145145

146+
if (this.showPresence) {
147+
this.personPresence = null;
148+
}
149+
146150
this.requestStateUpdate();
147151
this.requestUpdate('personDetails');
148152
}

0 commit comments

Comments
 (0)