Skip to content
Snippets Groups Projects
Unverified Commit aea82fad authored by Greg Fodor's avatar Greg Fodor Committed by GitHub
Browse files

Merge pull request #617 from mozilla/feature/ret-channel

Add ret channel
parents 0090cc6b 38abd0a7
No related branches found
No related tags found
No related merge requests found
......@@ -379,12 +379,14 @@ document.addEventListener("DOMContentLoaded", () => {
console.log(`Hub ID: ${hubId}`);
const socket = connectToReticulum(isDebug);
const channel = socket.channel(`hub:${hubId}`, {});
channel
// Hub local channel
const hubPhxChannel = socket.channel(`hub:${hubId}`, {});
hubPhxChannel
.join()
.receive("ok", async data => {
hubChannel.setPhoenixChannel(channel);
hubChannel.setPhoenixChannel(hubPhxChannel);
await handleHubChannelJoined(entryManager, hubChannel, data);
})
.receive("error", res => {
......@@ -396,10 +398,16 @@ document.addEventListener("DOMContentLoaded", () => {
console.error(res);
});
channel.on("naf", data => {
hubPhxChannel.on("naf", data => {
if (!NAF.connection.adapter) return;
NAF.connection.adapter.onData(data);
});
// Reticulum global channel
const retPhxChannel = socket.channel(`ret`, { hub_id: hubId });
retPhxChannel.join().receive("error", res => {
console.error(res);
});
linkChannel.setSocket(socket);
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment