Skip to content

Commit 828e761

Browse files
committed
✨ feat(#170): 로그인 페이지에서 편지 전송 store 초기화 (비회원용)
1 parent 4eca67d commit 828e761

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/app/login/page.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,30 @@
33
import Loader, { LoaderContainer } from '@/components/common/Loader';
44
import OauthButton from '@/components/signup/OauthButton';
55
import { OAUTH } from '@/constants/oauth';
6+
import { sendLetterState } from '@/recoil/letterStore';
67
import { theme } from '@/styles/theme';
78
import { OAuthType } from '@/types/login';
89
import { useRouter } from 'next/navigation';
9-
import { Suspense } from 'react';
10+
import { Suspense, useEffect } from 'react';
11+
import { useRecoilState } from 'recoil';
1012
import styled from 'styled-components';
1113

1214
export default function Login() {
1315
const router = useRouter();
16+
const [, setSendState] = useRecoilState(sendLetterState);
17+
18+
/* 로그인 페이지에서 편지 쓰기 store 초기화 */
19+
useEffect(() => {
20+
setSendState({
21+
draftId: null,
22+
receiverName: '',
23+
content: '',
24+
images: [] as string[],
25+
previewImages: [] as string[],
26+
templateType: 0,
27+
letterId: null
28+
});
29+
}, []);
1430

1531
const handleGuestLetterStart = () => {
1632
router.push('/send/receiver?guest=true');

0 commit comments

Comments
 (0)