Skip to content

Commit 11448ea

Browse files
authored
Merge pull request #519 from meowzip/reese
feat: 에러 처리 개선 및 queryKey 이슈 수정
2 parents 4936cd8 + e06721c commit 11448ea

File tree

24 files changed

+332
-106
lines changed

24 files changed

+332
-106
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"react": "18.3.1",
4141
"react-day-picker": "^8.10.1",
4242
"react-dom": "18.3.1",
43+
"react-error-boundary": "^6.0.0",
4344
"react-hook-form": "^7.58.1",
4445
"react-icons": "^5.2.1",
4546
"react-intersection-observer": "^9.13.1",

pnpm-lock.yaml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/@modal/(...)community/write/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function InterceptedDiaryWriteModal() {
3636
queryKey: ['feedDetail', feedId],
3737
queryFn: () => getFeedDetail(feedId as number),
3838
enabled: !!feedId && !isNaN(feedId),
39-
staleTime: 0
39+
staleTime: 5 * 60 * 1000
4040
});
4141

4242
if (isLoading && feedId) {

src/app/@modal/(...)diary/[id]/edit/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const DiaryEditModalPage = ({ params: { id } }: { params: { id: number } }) => {
1616
} = useQuery({
1717
queryKey: ['diaryDetail', id],
1818
queryFn: () => getDiaryDetail(id),
19-
staleTime: 0
19+
staleTime: 5 * 60 * 1000
2020
});
2121

2222
const handleClose = () => {

src/app/community/[slug]/page.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@ export async function generateMetadata({
1313
}: PageProps): Promise<Metadata> {
1414
if (params.slug === 'write') {
1515
return {
16-
title: '피드 작성 | 냥집사',
17-
description: '냥집사 커뮤니티 피드 작성'
16+
title: '피드 작성 | 냥.zip',
17+
description: '냥.zip 커뮤니티 피드 작성'
1818
};
1919
}
2020

2121
const slug = Number(params.slug);
2222

2323
if (!params.slug || isNaN(slug)) {
2424
return {
25-
title: '피드 | 냥집사',
26-
description: '냥집사 커뮤니티 피드'
25+
title: '피드 | 냥.zip',
26+
description: '냥.zip 커뮤니티 피드'
2727
};
2828
}
2929

3030
try {
3131
const feedDetail = await getFeedDetail(slug);
3232

3333
return {
34-
title: `${feedDetail.writerNickname}님의 피드 | 냥집사`,
34+
title: `${feedDetail.writerNickname}님의 피드 | 냥.zip`,
3535
description: feedDetail.content.slice(0, 100) + '...',
3636
openGraph: {
3737
title: `${feedDetail.writerNickname}님의 피드`,
@@ -48,8 +48,8 @@ export async function generateMetadata({
4848
};
4949
} catch (error) {
5050
return {
51-
title: '피드 | 냥집사',
52-
description: '냥집사 커뮤니티 피드'
51+
title: '피드 | 냥.zip',
52+
description: '냥.zip 커뮤니티 피드'
5353
};
5454
}
5555
}

src/app/diary/[id]/edit/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const DiaryEditModalPage = ({ params: { id } }: { params: { id: number } }) => {
1212
const { data: diaryDetail } = useQuery({
1313
queryKey: ['diaryDetail', id],
1414
queryFn: () => getDiaryDetail(id),
15-
staleTime: 0
15+
staleTime: 5 * 60 * 1000
1616
});
1717

1818
const handleClose = () => {

src/app/diary/[id]/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ export async function generateMetadata({
1313

1414
if (!params.id || isNaN(id)) {
1515
return {
16-
title: '일지 | 냥집사',
17-
description: '냥집사 일지'
16+
title: '일지 | 냥.zip',
17+
description: '냥.zip 일지'
1818
};
1919
}
2020

2121
try {
2222
const diaryDetail = await getDiaryDetail(id);
2323

2424
return {
25-
title: `${diaryDetail.caredDate} 일지 | 냥집사`,
25+
title: `${diaryDetail.caredDate} 일지 | 냥.zip`,
2626
description: diaryDetail.content.slice(0, 100) + '...',
2727
openGraph: {
2828
title: `${diaryDetail.caredDate} 일지`,
@@ -39,8 +39,8 @@ export async function generateMetadata({
3939
};
4040
} catch (error) {
4141
return {
42-
title: '일지 | 냥집사',
43-
description: '냥집사 일지'
42+
title: '일지 | 냥.zip',
43+
description: '냥.zip 일지'
4444
};
4545
}
4646
}

src/app/profile/[id]/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ export async function generateMetadata({
1313

1414
if (!params.id || isNaN(id)) {
1515
return {
16-
title: '프로필 | 냥집사',
17-
description: '냥집사 유저 프로필'
16+
title: '프로필 | 냥.zip',
17+
description: '냥.zip 유저 프로필'
1818
};
1919
}
2020

2121
try {
2222
const profileData = await getClickedUserProfile(id);
2323

2424
return {
25-
title: `${profileData.nickname}님의 프로필 | 냥집사`,
25+
title: `${profileData.nickname}님의 프로필 | 냥.zip`,
2626
description: `고양이 ${profileData.catCount}마리, 게시물 ${profileData.postCount}개`,
2727
openGraph: {
2828
title: `${profileData.nickname}님의 프로필`,
@@ -41,8 +41,8 @@ export async function generateMetadata({
4141
};
4242
} catch (error) {
4343
return {
44-
title: '프로필 | 냥집사',
45-
description: '냥집사 유저 프로필'
44+
title: '프로필 | 냥.zip',
45+
description: '냥.zip 유저 프로필'
4646
};
4747
}
4848
}

src/app/profile/[id]/zip/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ export async function generateMetadata({
1616

1717
if (!params.id || isNaN(id)) {
1818
return {
19-
title: '모음집 | 냥집사',
20-
description: '냥집사 고양이 모음집'
19+
title: '모음집 | 냥.zip',
20+
description: '냥.zip 고양이 모음집'
2121
};
2222
}
2323

2424
try {
2525
const profileData = await getClickedUserProfile(id);
2626

2727
return {
28-
title: `${profileData.nickname}님의 모음집 | 냥집사`,
28+
title: `${profileData.nickname}님의 모음집 | 냥.zip`,
2929
description: `${profileData.nickname}님이 돌보는 고양이들을 만나보세요`,
3030
openGraph: {
3131
title: `${profileData.nickname}님의 모음집`,
@@ -38,8 +38,8 @@ export async function generateMetadata({
3838
};
3939
} catch (error) {
4040
return {
41-
title: '모음집 | 냥집사',
42-
description: '냥집사 고양이 모음집'
41+
title: '모음집 | 냥.zip',
42+
description: '냥.zip 고양이 모음집'
4343
};
4444
}
4545
}

src/app/providers.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
1111
import { HttpError } from '@/utils/returnFetchJson';
1212
import { authStore, sessionExpiredModalAtom } from '@/store/authAtom';
13+
import AppErrorBoundary from '@/components/common/AppErrorBoundary';
1314

1415
const Providers = ({ children }: any): React.JSX.Element => {
1516
const [queryClient] = useState(() => {
@@ -45,8 +46,13 @@ const Providers = ({ children }: any): React.JSX.Element => {
4546

4647
return (
4748
<QueryClientProvider client={queryClient}>
48-
{children}
49-
<ReactQueryDevtools initialIsOpen={false} buttonPosition="bottom-left" />
49+
<AppErrorBoundary>
50+
{children}
51+
<ReactQueryDevtools
52+
initialIsOpen={false}
53+
buttonPosition="bottom-left"
54+
/>
55+
</AppErrorBoundary>
5056
</QueryClientProvider>
5157
);
5258
};

0 commit comments

Comments
 (0)