cleaning a bunch of the auth stuff but not done

This commit is contained in:
talksik
2022-04-01 11:10:37 -04:00
parent 95fe01af03
commit 685c03e505
18 changed files with 554 additions and 678 deletions
+15 -14
View File
@@ -3,26 +3,27 @@ import { useEffect, useState } from "react";
import SocketChannels from "@nirvana/core/sockets/channels";
import { UserStatus } from "../../../core/models/user.model";
import { socket } from "../nirvanaApp";
import { useGetAllContactBasicDetails } from "./index";
// import { useGetAllContactBasicDetails } from "./index";
export default function useSocketData() {
// relationshipId's of the conversations where there is someone speaking
const [speakingRooms, setSpeakingRooms] = useState<string[]>([]);
const { data: allConvosDetsResponse, isFetched } =
useGetAllContactBasicDetails();
// const { data: allConvosDetsResponse, isFetched } =
// useGetAllContactBasicDetails();
useEffect(() => {
if (allConvosDetsResponse) {
allConvosDetsResponse.contactsDetails.map((contactDet) => {
// join the right rooms based on the relevant contacts/conversations returned here
socket.emit(
SocketChannels.JOIN_ROOM,
contactDet.relationship._id.toString()
);
});
}
}, [isFetched]);
// useEffect(() => {
// if (allConvosDetsResponse) {
// allConvosDetsResponse.contactsDetails.map((contactDet) => {
// // join the right rooms based on the relevant contacts/conversations returned here
// socket.emit(
// SocketChannels.JOIN_ROOM,
// contactDet.relationship._id.toString()
// );
// });
// }
// }, [isFetched]);
useEffect(() => {
socket.on(