From 34f0e11a665d404595460046e598c73a8c0e8f28 Mon Sep 17 00:00:00 2001 From: Allison Chiang Date: Thu, 13 Jun 2024 13:33:07 -0700 Subject: [PATCH 1/3] add message when mutedByOthers event received --- Project/src/MakeCall/CallCard.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Project/src/MakeCall/CallCard.js b/Project/src/MakeCall/CallCard.js index f302064..9480496 100644 --- a/Project/src/MakeCall/CallCard.js +++ b/Project/src/MakeCall/CallCard.js @@ -262,6 +262,12 @@ export default class CallCard extends React.Component { } }); + this.call.on('mutedByOthers', () => { + const messageBarText = 'Muted by someone else'; + console.log(messageBarText); + this.setState({ callMessage: messageBarText }) + }); + const handleParticipant = (participant) => { if (!this.state.remoteParticipants.find((p) => { return p === participant })) { this.setState(prevState => ({ From 570d62e4c9ef9ddc7ad1f61305fb2349c9fc556f Mon Sep 17 00:00:00 2001 From: Allison Chiang Date: Thu, 13 Jun 2024 14:40:37 -0700 Subject: [PATCH 2/3] improve concatenation --- Project/src/MakeCall/CallCard.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Project/src/MakeCall/CallCard.js b/Project/src/MakeCall/CallCard.js index 9480496..b0da5ae 100644 --- a/Project/src/MakeCall/CallCard.js +++ b/Project/src/MakeCall/CallCard.js @@ -263,9 +263,12 @@ export default class CallCard extends React.Component { }); this.call.on('mutedByOthers', () => { - const messageBarText = 'Muted by someone else'; + const messageBarText = 'You have been muted by someone else. Unmute to speak.'; console.log(messageBarText); - this.setState({ callMessage: messageBarText }) + this.setState(prevState => ({ + ...prevState, + callMessage: `${prevState.callMessage ? prevState.callMessage + `\n` : ``} ${messageBarText}.` + })); }); const handleParticipant = (participant) => { From 50919856c339a1be526c8608d5d0be953fd1c1d0 Mon Sep 17 00:00:00 2001 From: allchiang-msft <113146208+allchiang-msft@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:31:15 -0700 Subject: [PATCH 3/3] remove console log --- Project/src/MakeCall/CallCard.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Project/src/MakeCall/CallCard.js b/Project/src/MakeCall/CallCard.js index b0da5ae..66ae7da 100644 --- a/Project/src/MakeCall/CallCard.js +++ b/Project/src/MakeCall/CallCard.js @@ -264,7 +264,6 @@ export default class CallCard extends React.Component { this.call.on('mutedByOthers', () => { const messageBarText = 'You have been muted by someone else. Unmute to speak.'; - console.log(messageBarText); this.setState(prevState => ({ ...prevState, callMessage: `${prevState.callMessage ? prevState.callMessage + `\n` : ``} ${messageBarText}.`