speaking and not speaking working nicely with sockets

This commit is contained in:
talksik
2022-03-21 23:44:28 -04:00
parent 2fc91a0ccb
commit 61900d4474
4 changed files with 47 additions and 37 deletions
@@ -132,13 +132,23 @@ export default function SelectedConversation() {
const socketStartedSpeaking = () => {
// send the room name and the update type
socket.emit(SocketChannels.SEND_STARTED_SPEAKING_TO_SERVER, selectedConvo);
// only send if we are in a relationship
if (convoDetailsResponse.ourRelationship._id.toString())
socket.emit(
SocketChannels.SEND_STARTED_SPEAKING,
convoDetailsResponse.ourRelationship._id.toString()
);
};
const socketStopSpeaking = () => {
// send the room name and the update type
socket.emit(SocketChannels.SEND_STOPPED_SPEAKING_TO_SERVER, selectedConvo);
// only send if we are in a relationship
if (convoDetailsResponse.ourRelationship._id.toString())
socket.emit(
SocketChannels.SEND_STOPPED_SPEAKING,
convoDetailsResponse.ourRelationship._id.toString()
);
};
// hot keys for closing this window