Skip to content

Commit

Permalink
Fixing app channel for app2
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed Sep 25, 2024
1 parent 8c54dbf commit 4bee616
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions toolbox/fdc3-for-web/demo/src/client/apps/app2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ getAgent().then(async fdc3 => {
const info = await fdc3.getInfo()
msg.textContent = "FDC3 Loaded: " + JSON.stringify(info);
log?.appendChild(msg);
const channels = await fdc3.getUserChannels()

fdc3.joinUserChannel(channels[0].id)
const cc = await fdc3.getCurrentChannel()
if (cc == null) {
const channels = await fdc3.getUserChannels()
await fdc3.joinUserChannel(channels[0].id)
}

fdc3.addContextListener(null, context => {
const msg = document.createElement("p");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class HeartbeatHandler implements MessageHandler {
const app = sc.getInstanceDetails(from)
if (app) {
sc.setAppState(from, State.Terminated)
this
this.lastHeartbeats.delete(from)
}
}
}
Expand Down

0 comments on commit 4bee616

Please sign in to comment.