Skip to content

Commit

Permalink
Revert "[#612] 북카이브 페이지에서 발생하는 무한 리랜더링 버그 수정 (#613)"
Browse files Browse the repository at this point in the history
This reverts commit bac4ff2.
  • Loading branch information
gxxrxn authored Aug 20, 2024
1 parent 921ab74 commit 5257e61
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/app/bookarchive/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
'use client';

import useMyProfileQuery from '@/queries/user/useMyProfileQuery';

import { checkAuthentication } from '@/utils/helpers';

import SSRSafeSuspense from '@/components/SSRSafeSuspense';
import { Suspense } from 'react';
import useMounted from '@/hooks/useMounted';
import BookArchiveForAuth from '@/v1/bookArchive/BookArchiveForAuth';
import BookArchiveForUnAuth from '@/v1/bookArchive/BookArchiveForUnAuth';
import TopHeader from '@/v1/base/TopHeader';
Expand All @@ -14,9 +13,9 @@ export default function BookArchivePage() {
<div className="flex w-full flex-col gap-[1rem] pb-[2rem]">
<TopHeader text="BookArchive" />
{/* TODO: 스켈레톤 컴포넌트로 교체 */}
<SSRSafeSuspense fallback={null}>
<Suspense fallback={null}>
<Contents />
</SSRSafeSuspense>
</Suspense>
</div>
);
}
Expand All @@ -26,6 +25,8 @@ const Contents = () => {
const { data: userData } = useMyProfileQuery({
enabled: isAuthenticated,
});
const mounted = useMounted();
if (!mounted) return null;

return isAuthenticated ? (
<BookArchiveForAuth userJobGroup={userData.job.jobGroupName} />
Expand Down

0 comments on commit 5257e61

Please sign in to comment.