adding template/flow for adding in a line I was added to

This commit is contained in:
talksik
2022-05-07 15:41:57 -05:00
parent cc02c95b2d
commit 79cfdc4b96
2 changed files with 4 additions and 3 deletions
@@ -24,9 +24,6 @@ export default function LineRow({
const [selectedLineId, setSelectedLineId] = useRecoilState($selectedLineId);
const { data: userData } = useGetUserDetails();
// TODO: p2 move those socket handler functions to another hook so that they don't come from the context as this will cause each line row to re-render on changes to the context state/value
const { handleUnTuneToLine } = useLineDataProvider();
// take the source of truth list of memeberIds tuned in, and see if I'm in it
const isUserTunedIn = useMemo(
() =>
@@ -58,6 +58,10 @@ function useSocketHandler(linesData: MasterLineData[]) {
* initiate listeners
*/
useEffect(() => {
/**
* TODO: P0 : notified that someone else added me to a line they created
*/
// when me or anyone just initially connects to line
$ws.on(
ServerResponseChannels.SOMEONE_CONNECTED_TO_LINE,