Skip to content

Commit

Permalink
refactor: 모달이 닫혀도 다시 나오는 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
khj0426 committed May 22, 2024
1 parent 44b726c commit db77f08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Component/Blog/RecommendPostModal/RecommendPostModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export default function RecommendPostModal({
randomPosts: Item[];
}) {
const [close, setClose] = useRecoilState(postRecommendModalClose);
const { modal, closeModal, openModal } = useModal('RECOMMEND_POST_MODAL');
const { modal, closeModal, openModal } = useModal(
'POST_RECOMMEND_MODAL_STATE'
);
const { target } = useIntersectionObserver({
threshold: 1,
callback: () => openModal(),
Expand Down
2 changes: 1 addition & 1 deletion src/app/Providers/Recoil/globalAtom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const modalIdAtom = atom<string[]>({
export const postRecommendModalClose = atom<boolean>({
key: 'POST_RECOMMEND_MODAL_STATE',
default: false,
effects: [sessionStorageEffect<boolean>('POST_SEARCH_MODAL_STATE')],
effects: [sessionStorageEffect<boolean>('POST_RECOMMEND_MODAL_STATE')],
});

export const modalSelectorFamily = selectorFamily({
Expand Down

0 comments on commit db77f08

Please sign in to comment.