Skip to content

Commit

Permalink
Add support for broadcasting a context when a call starts to a user.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnman committed Mar 25, 2024
1 parent 9028371 commit 8e54717
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ function initializeDOM() {
} else {
action.textContent = `End Call${contactNameLabel}`;
seconds = 0;
const userChannel = await fdc3.getCurrentChannel();
if (
window.fdc3 !== undefined &&
userChannel !== undefined &&
userChannel !== null &&
currentContact !== undefined
) {
console.log(`Current Channel: ${userChannel.id}`);
fdc3.broadcast(currentContact);
}
update();
intervalId = setInterval(() => {
update();
Expand All @@ -60,7 +70,7 @@ function initializeDOM() {
* @param intentName The intent name.
*/
function updateCallInformation(ctx, intentName) {
if (ctx !== undefined) {
if (ctx !== undefined && (currentContact === undefined || currentContact.name !== ctx.name)) {
if (ctx.type === 'fdc3.contact') {
contactNameLabel = ` To ${ctx.name}`;
contactHeaderLabel.textContent = ctx.name;
Expand Down

0 comments on commit 8e54717

Please sign in to comment.