Skip to content

Commit

Permalink
fix: 모임 생성 최신미팅 반영 (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrevile authored Aug 27, 2024
1 parent 8a09e4c commit ab56385
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
24 changes: 10 additions & 14 deletions packages/web-domains/src/home/common/hooks/useSetCurrentMeeting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -19,11 +18,6 @@ export const useGatherMemberProfileListService = () => {
const [gatherMemberList, setGatherMemberList] = useState<MemberType[]>([]);
const meetingId = currentMeeting?.meetingId;

const { data: myInfo } = useGetMyInfo({
params: { meetingId: meetingId! },
options: { enabled: !!meetingId },
});

const { data } = useGetGatherMemberList({
params: { meetingId: meetingId! },
options: {
Expand Down Expand Up @@ -59,10 +53,10 @@ export const useGatherMemberProfileListService = () => {
};

useEffect(() => {
if (data?.contents && myInfo) {
if (data?.contents) {
setGatherMemberList(data?.contents);
}
}, [data, myInfo]);
}, [data]);

useEffect(() => {
let filter;
Expand Down

0 comments on commit ab56385

Please sign in to comment.