Skip to content

Commit 3222061

Browse files
authored
[25.07.08 / TASK-223] Fix - Sentry에서 감지된 여러 오류들 해결 (#45)
1 parent 2440457 commit 3222061

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

src/apis/instance.request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import returnFetch, { FetchArgs } from 'return-fetch';
33
import { ENVS } from '@/constants';
44
import { ServerNotRespondingError } from '@/errors';
55

6-
const ABORT_MS = 10000;
6+
const ABORT_MS = 5000;
77

88
type ErrorType = {
99
code: string;

src/app/(auth-required)/leaderboards/Content.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,18 @@ export const Content = () => {
2626
});
2727

2828
const data = useMemo(() => {
29-
const isUserBased = searchParams.based === 'user';
30-
const isViewBased = searchParams.sort === 'viewCount';
29+
const isUserBased = searchParams?.based === 'user';
30+
const isViewBased = searchParams?.sort === 'viewCount';
3131

32-
const value = (isUserBased ? boards?.users : boards?.posts) as LeaderboardItemType[];
32+
const value = ((isUserBased ? boards?.users : boards?.posts) || []) as LeaderboardItemType[];
3333

34-
return (
35-
value.map(({ username, title, viewDiff, likeDiff, slug }) => ({
36-
key: isUserBased ? username : title,
37-
username,
38-
url: URLS.VELOG + `/@${username}` + (isUserBased ? '/posts' : `/${slug}`),
39-
value: isViewBased ? viewDiff : likeDiff,
40-
})) || []
41-
);
42-
}, [boards, searchParams.based, searchParams.sort]);
34+
return value.map(({ username, title, viewDiff, likeDiff, slug }) => ({
35+
key: isUserBased ? username : title,
36+
username,
37+
url: URLS.VELOG + `/@${username}` + (isUserBased ? '/posts' : `/${slug}`),
38+
value: isViewBased ? viewDiff : likeDiff,
39+
}));
40+
}, [boards, searchParams?.based, searchParams?.sort]);
4341

4442
const handleChange = (param: Partial<searchParamsType>) => {
4543
startHolyLoader();

src/app/(auth-required)/main/Content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const Content = () => {
4848
fetchNextPage();
4949
}, [inView]);
5050

51-
const joinedPosts = useMemo(() => posts?.pages.flatMap((i) => i.posts), [posts]);
51+
const joinedPosts = useMemo(() => posts?.pages.flatMap((i) => i.posts) || [], [posts]);
5252

5353
return (
5454
<div className="flex w-full h-full gap-[30px] max-MBI:flex-col max-TBL:gap-[20px] overflow-hidden">

0 commit comments

Comments
 (0)