handling temporary tune in kind of

This commit is contained in:
talksik
2022-05-07 11:30:23 -05:00
parent c6c592c214
commit 2c8ca0a62b
3 changed files with 20 additions and 15 deletions
@@ -30,7 +30,6 @@ function useSocketHandler(linesData: MasterLineData[]) {
const jwtToken = useRecoilValue($jwtToken);
const [linesMap, setLinesMap] = useState<LineIdToMasterLine>({});
const { data: userDetails } = useGetUserDetails();
/**
* handle ws connection
@@ -102,7 +101,10 @@ function useSocketHandler(linesData: MasterLineData[]) {
newMap[res.lineId].tunedInMemberIds = res.allTunedIntoUserIds;
// if user is me, make sure to show me my updated line member association
if (userDetails.user._id.toString() === res.userId) {
if (
newMap[res.lineId].currentUserMember?._id.toString() ===
res.userId
) {
console.log(
"updated my line member state for this line | is toggle tuned in: ",
res.toggledIn