Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions src/feature/photo-entry/components/ScreenPhotoShareEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import CheckNoImgModal from '@/feature/upload/components/CheckNoImgModal';
import CustomHeader from '@/global/components/header/CustomHeader';
import LongButton from '@/global/components/LongButton';
import BubbleTooltip from '@/global/components/tooltip/BubbleTooltip';
import { useABTestGroup } from '@/global/hooks/useABTestGroup';
import { useQueryClient } from '@tanstack/react-query';
import { useRouter, useSearchParams } from 'next/navigation';
import { useEffect, useRef } from 'react';
Expand All @@ -25,12 +26,25 @@ export default function ScreenPhotoShareEntry({

const { mutateAsync } = useAlbumEnterMutation();
const { data } = useGetAlbumAvailableCount(albumId);
const abGroup = useABTestGroup();

useEffect(() => {
if (!isInvite) return;
if (!isInvite) {
if (abGroup === 'B') {
router.replace(`/album/detail/${albumId}`);
}
return;
}

mutateAsync({ albumId });
}, []);
// 초대 유입의 경우 앨범 진입(enter) 완료 후 B그룹이면 상세로 리다이렉트
mutateAsync({ albumId }).then(() => {
const match = document.cookie.match(/(^| )ab_test_group=([^;]+)/);
const activeGroup = match ? match[2] : abGroup;
if (activeGroup === 'B') {
router.replace(`/album/detail/${albumId}`);
}
});
}, [isInvite, abGroup, albumId, router, mutateAsync]);
Comment thread
dasosann marked this conversation as resolved.
Outdated

const handleUpload = () => {
fileInputRef.current?.click();
Expand All @@ -42,6 +56,10 @@ export default function ScreenPhotoShareEntry({
await handleFileUpload(e, albumId, router, { queryClient });
};

if (abGroup === null || abGroup === 'B') {
return null;
}
Comment thread
dasosann marked this conversation as resolved.
Outdated

return (
<>
<CustomHeader title='앨범 채우기' />
Expand Down
Loading