supporting previous event socket format

This commit is contained in:
Roland Osborne 2023-04-14 11:02:29 -07:00
parent b246fc8f44
commit a95f7323e0

View File

@ -167,7 +167,7 @@ export function useAppContext() {
}
const setWebsocket = (session) => {
ws.current = createWebsocket(`wss://${session.server}/status`);
ws.current = createWebsocket(`wss://${session.server}/status?mode=ring`);
ws.current.onmessage = (ev) => {
try {
delay.current = 0;
@ -181,10 +181,17 @@ export function useAppContext() {
channel.actions.setRevision(channelRev);
card.actions.setRevision(cardRev);
}
if (activity.ring) {
else if (activity.ring) {
const { cardId, callId, calleeToken, iceUrl, iceUsername, icePassword } = activity.ring;
ring.actions.ring(cardId, callId, calleeToken, iceUrl, iceUsername, icePassword);
}
else {
const { profile: profileRev, account: accountRev, channel: channelRev, card: cardRev } = activity;
profile.actions.setRevision(profileRev);
account.actions.setRevision(accountRev);
channel.actions.setRevision(channelRev);
card.actions.setRevision(cardRev);
}
}
catch (err) {
console.log(err);