From 79cfdc4b96898ebaef7e5b1b3d931d0db5346b66 Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 7 May 2022 15:41:57 -0500 Subject: [PATCH] adding template/flow for adding in a line I was added to --- packages/desktop/src/components/lines/lineRow.tsx/index.tsx | 3 --- packages/desktop/src/controller/lineDataProvider.tsx | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/desktop/src/components/lines/lineRow.tsx/index.tsx b/packages/desktop/src/components/lines/lineRow.tsx/index.tsx index 0476dea..8c688d7 100644 --- a/packages/desktop/src/components/lines/lineRow.tsx/index.tsx +++ b/packages/desktop/src/components/lines/lineRow.tsx/index.tsx @@ -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( () => diff --git a/packages/desktop/src/controller/lineDataProvider.tsx b/packages/desktop/src/controller/lineDataProvider.tsx index 5e08484..e8fc53a 100644 --- a/packages/desktop/src/controller/lineDataProvider.tsx +++ b/packages/desktop/src/controller/lineDataProvider.tsx @@ -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,