untuning with escape...which should then remove from tunedids list and thus the source of truth whether or not to render the peer connector and rtc stuff

This commit is contained in:
talksik
2022-05-07 14:24:01 -05:00
parent 845354e067
commit 424b1c56a4
3 changed files with 39 additions and 13 deletions
+10 -10
View File
@@ -86,7 +86,7 @@ export default function InitializeWs(io: any) {
console.log(`${socket.id} now in rooms ${socket.rooms}`);
const clientUserIdsInRoom = [
...io.sockets.adapter.rooms.get(roomName),
...(io.sockets.adapter.rooms.get(roomName) ?? []),
].map(
(otherUserSocketId: string) => socketIdsToUserIds[otherUserSocketId]
);
@@ -102,6 +102,13 @@ export default function InitializeWs(io: any) {
}
);
/**
* TODO: handle when user wants to completely leave a line (delete or removed from one)
*/
socket.on(ServerRequestChannels.DISCONNECT_FROM_LINE, () =>
console.log("not implemented")
);
/** TUNE | User tunes into the line either temporarily or toggled in */
socket.on(
ServerRequestChannels.TUNE_INTO_LINE,
@@ -131,7 +138,7 @@ export default function InitializeWs(io: any) {
}
const clientUserIdsInRoom = [
...io.sockets.adapter.rooms.get(roomName),
...(io.sockets.adapter.rooms.get(roomName) ?? []),
].map(
(otherUserSocketId: string) => socketIdsToUserIds[otherUserSocketId]
);
@@ -151,13 +158,6 @@ export default function InitializeWs(io: any) {
}
);
/**
* TODO: handle when user wants to completely leave a line (delete or removed from one)
*/
socket.on(ServerRequestChannels.DISCONNECT_FROM_LINE, () =>
console.log("not implemented")
);
/**
* Notify all connected users when someone UNTUNES from a room
* ?might not be needed, all users' memory of tuned in users is irrelevant? don't need real time? but UI will show # of users tuned in?
@@ -171,7 +171,7 @@ export default function InitializeWs(io: any) {
console.log("someone left room");
const clientUserIdsInRoom = [
...io.sockets.adapter.rooms.get(roomName),
...(io.sockets.adapter.rooms.get(roomName) ?? []),
].map(
(otherUserSocketId: string) => socketIdsToUserIds[otherUserSocketId]
);