From ab5638535848b40f3f6950b5d61a6480e88f5459 Mon Sep 17 00:00:00 2001 From: Jong Date: Wed, 28 Aug 2024 00:19:15 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=AA=A8=EC=9E=84=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=20=EC=B5=9C=EC=8B=A0=EB=AF=B8=ED=8C=85=20=EB=B0=98=EC=98=81=20?= =?UTF-8?q?(#167)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BottomSheet/BottomSheet.styles.ts | 4 ++-- .../home/common/hooks/useSetCurrentMeeting.ts | 24 ++++++++----------- .../useGatherMemberProfileListService.tsx | 10 ++------ 3 files changed, 14 insertions(+), 24 deletions(-) diff --git a/packages/web-domains/src/home/common/components/BottomSheet/BottomSheet.styles.ts b/packages/web-domains/src/home/common/components/BottomSheet/BottomSheet.styles.ts index daaf351e..0a82b482 100644 --- a/packages/web-domains/src/home/common/components/BottomSheet/BottomSheet.styles.ts +++ b/packages/web-domains/src/home/common/components/BottomSheet/BottomSheet.styles.ts @@ -33,6 +33,6 @@ export const ContentWrapperCss = css({ transition: 'transform 0.2s ease', height: 'calc(100% - 54px)', backgroundColor: `${colors.grey200}`, - padding: '8px 0', - overflow: 'auto', + padding: '8px 0 40px', + overflow: 'hidden', }); diff --git a/packages/web-domains/src/home/common/hooks/useSetCurrentMeeting.ts b/packages/web-domains/src/home/common/hooks/useSetCurrentMeeting.ts index 65192436..740ba886 100644 --- a/packages/web-domains/src/home/common/hooks/useSetCurrentMeeting.ts +++ b/packages/web-domains/src/home/common/hooks/useSetCurrentMeeting.ts @@ -37,25 +37,21 @@ export const useSetCurrentMeeting = () => { } } }; - useEffect(() => { - if (currentMeeting) { - setCurrentMeeting(null); - } - }, []); useEffect(() => { - if (!currentMeeting) { - const lastVisitedMeeting = getCurrentMeeting(meetingInfo); - - try { - if (lastVisitedMeeting) { - mutateAsync({ meetingId: lastVisitedMeeting.meetingId }); - } - } catch (error) { - console.log(error); + const lastVisitedMeeting = getCurrentMeeting(meetingInfo); + try { + if (lastVisitedMeeting) { + mutateAsync({ meetingId: lastVisitedMeeting.meetingId }); } setCurrentMeeting(lastVisitedMeeting); + } catch (error) { + console.log(error); } + + return () => { + setCurrentMeeting(null); + }; }, [meetingInfo]); return { diff --git a/packages/web-domains/src/home/features/gather-member/services/useGatherMemberProfileListService.tsx b/packages/web-domains/src/home/features/gather-member/services/useGatherMemberProfileListService.tsx index 435235f2..4c5c41c8 100644 --- a/packages/web-domains/src/home/features/gather-member/services/useGatherMemberProfileListService.tsx +++ b/packages/web-domains/src/home/features/gather-member/services/useGatherMemberProfileListService.tsx @@ -6,7 +6,6 @@ import { getWebDomain } from '@/common'; import { generateInviteLink } from '@/common/utils/generateInviteLink'; import { getKeywordRegex } from '@/common/utils/getKeywordRegex'; import { useGetInviteCode } from '@/home/common/apis/queries/useGetInviteCode'; -import { useGetMyInfo } from '@/home/common/apis/queries/useGetMyInfo'; import { MemberType } from '@/home/common/apis/schema/useGetProgressingQuestionQuery.type'; import { HomeAtoms } from '@/home/common/atoms/home.atom'; @@ -19,11 +18,6 @@ export const useGatherMemberProfileListService = () => { const [gatherMemberList, setGatherMemberList] = useState([]); const meetingId = currentMeeting?.meetingId; - const { data: myInfo } = useGetMyInfo({ - params: { meetingId: meetingId! }, - options: { enabled: !!meetingId }, - }); - const { data } = useGetGatherMemberList({ params: { meetingId: meetingId! }, options: { @@ -59,10 +53,10 @@ export const useGatherMemberProfileListService = () => { }; useEffect(() => { - if (data?.contents && myInfo) { + if (data?.contents) { setGatherMemberList(data?.contents); } - }, [data, myInfo]); + }, [data]); useEffect(() => { let filter;