Skip to content

Commit a3e0f76

Browse files
author
Sharif Rahaman
committed
Merge branch 'main' into domessin/entraid-auth
2 parents eb6ac5c + 8ebb542 commit a3e0f76

File tree

3 files changed

+69
-40
lines changed

3 files changed

+69
-40
lines changed

Project/package-lock.json

Lines changed: 51 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Project/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"@azure/communication-calling": "1.35.1-beta.1",
6+
"@azure/communication-calling": "1.37.1-beta.1",
77
"@azure/communication-calling-effects": "1.1.1-beta.1",
88
"@azure/communication-common": "^2.4.0",
99
"@azure/communication-identity": "^1.3.0",

Project/src/MakeCall/MakeCall.js

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ export default class MakeCall extends React.Component {
8686
identityMri: undefined
8787
};
8888

89-
setInterval(() => {
90-
if (this.state.ufdMessages.length > 0) {
91-
this.setState({ ufdMessages: this.state.ufdMessages.slice(1) });
92-
}
93-
}, 10000);
94-
9589
// override logger to be able to dowload logs locally
9690
AzureLogger.log = (...args) => {
9791
this.logBuffer.push(...args);
@@ -168,36 +162,35 @@ export default class MakeCall extends React.Component {
168162
e.added.forEach(call => {
169163
this.setState({ call: call });
170164

165+
const addToUfdMessages = (msg) => {
166+
const messageObj = { msg };
167+
this.setState(prevState => ({
168+
ufdMessages: [messageObj, ...prevState.ufdMessages]
169+
}));
170+
setTimeout(() => {
171+
this.setState(prevState => ({
172+
ufdMessages: prevState.ufdMessages.filter(m => m !== messageObj)
173+
}));
174+
}, 15000);
175+
};
176+
171177
const diagnosticChangedListener = (diagnosticInfo) => {
172-
const rmsg = `UFD Diagnostic changed:
178+
const msg = `UFD Diagnostic changed:
173179
Diagnostic: ${diagnosticInfo.diagnostic}
174180
Value: ${diagnosticInfo.value}
175181
Value type: ${diagnosticInfo.valueType}`;
176-
if (this.state.ufdMessages.length > 0) {
177-
// limit speakingWhileMicrophoneIsMuted diagnostic until another diagnostic is received
178-
if (diagnosticInfo.diagnostic === 'speakingWhileMicrophoneIsMuted' && this.state.ufdMessages[0].includes('speakingWhileMicrophoneIsMuted')) {
179-
console.info(rmsg);
180-
return;
181-
}
182-
this.setState({ ufdMessages: [rmsg, ...this.state.ufdMessages] });
183-
} else {
184-
this.setState({ ufdMessages: [rmsg] });
185-
}
182+
addToUfdMessages(msg);
186183
};
187184

188185
const remoteDiagnosticChangedListener = (diagnosticArgs) => {
189186
diagnosticArgs.diagnostics.forEach(diagnosticInfo => {
190-
const rmsg = `UFD Diagnostic changed:
187+
const msg = `UFD Diagnostic changed:
191188
Diagnostic: ${diagnosticInfo.diagnostic}
192189
Value: ${diagnosticInfo.value}
193190
Value type: ${diagnosticInfo.valueType}
194191
Participant Id: ${diagnosticInfo.participantId}
195192
Participant name: ${diagnosticInfo.remoteParticipant?.displayName}`;
196-
if (this.state.ufdMessages.length > 0) {
197-
this.setState({ ufdMessages: [rmsg, ...this.state.ufdMessages] });
198-
} else {
199-
this.setState({ ufdMessages: [rmsg] });
200-
}
193+
addToUfdMessages(msg);
201194
});
202195
};
203196

@@ -990,7 +983,7 @@ this.callAgent.on('incomingCall', async (args) => {
990983
isMultiline={true}
991984
onDismiss={() => { this.setState({ ufdMessages: [] }) }}
992985
dismissButtonAriaLabel="Close">
993-
{this.state.ufdMessages.map((msg, index) => <li key={index}>{msg}</li>)}
986+
{this.state.ufdMessages.map((msg, index) => <li key={index}>{msg.msg}</li>)}
994987
</MessageBar>
995988
}
996989
{

0 commit comments

Comments
 (0)