Skip to content

Commit 2591c90

Browse files
committed
refactor: 인증 관련 라우트 및 컴포넌트 제거, 난이도 이미지 선택 로직 수정
1 parent edc5088 commit 2591c90

File tree

5 files changed

+22
-30
lines changed

5 files changed

+22
-30
lines changed

src/routeTree.gen.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
1010

1111
import { Route as rootRouteImport } from './routes/__root'
12-
import { Route as AuthenticatedRouteImport } from './routes/_authenticated'
1312
import { Route as MissionRouteRouteImport } from './routes/mission/route'
1413
import { Route as IndexRouteImport } from './routes/index'
1514
import { Route as MyIndexRouteImport } from './routes/my/index'
@@ -22,10 +21,6 @@ import { Route as MissionMissionIdIndexRouteImport } from './routes/mission/$mis
2221
import { Route as MissionMissionIdSuccessIndexRouteImport } from './routes/mission/$missionId/success/index'
2322
import { Route as MissionMissionIdFailedIndexRouteImport } from './routes/mission/$missionId/failed/index'
2423

25-
const AuthenticatedRoute = AuthenticatedRouteImport.update({
26-
id: '/_authenticated',
27-
getParentRoute: () => rootRouteImport,
28-
} as any)
2924
const MissionRouteRoute = MissionRouteRouteImport.update({
3025
id: '/mission',
3126
path: '/mission',
@@ -113,7 +108,6 @@ export interface FileRoutesById {
113108
__root__: typeof rootRouteImport
114109
'/': typeof IndexRoute
115110
'/mission': typeof MissionRouteRouteWithChildren
116-
'/_authenticated': typeof AuthenticatedRoute
117111
'/mission/': typeof MissionIndexRoute
118112
'/my/': typeof MyIndexRoute
119113
'/mission/$missionId/': typeof MissionMissionIdIndexRoute
@@ -154,7 +148,6 @@ export interface FileRouteTypes {
154148
| '__root__'
155149
| '/'
156150
| '/mission'
157-
| '/_authenticated'
158151
| '/mission/'
159152
| '/my/'
160153
| '/mission/$missionId/'
@@ -169,7 +162,6 @@ export interface FileRouteTypes {
169162
export interface RootRouteChildren {
170163
IndexRoute: typeof IndexRoute
171164
MissionRouteRoute: typeof MissionRouteRouteWithChildren
172-
AuthenticatedRoute: typeof AuthenticatedRoute
173165
MyIndexRoute: typeof MyIndexRoute
174166
Oauth2RedirectIndexRoute: typeof Oauth2RedirectIndexRoute
175167
OnboardingGymIndexRoute: typeof OnboardingGymIndexRoute
@@ -179,13 +171,6 @@ export interface RootRouteChildren {
179171

180172
declare module '@tanstack/react-router' {
181173
interface FileRoutesByPath {
182-
'/_authenticated': {
183-
id: '/_authenticated'
184-
path: ''
185-
fullPath: ''
186-
preLoaderRoute: typeof AuthenticatedRouteImport
187-
parentRoute: typeof rootRouteImport
188-
}
189174
'/mission': {
190175
id: '/mission'
191176
path: '/mission'
@@ -287,7 +272,6 @@ const MissionRouteRouteWithChildren = MissionRouteRoute._addFileChildren(
287272
const rootRouteChildren: RootRouteChildren = {
288273
IndexRoute: IndexRoute,
289274
MissionRouteRoute: MissionRouteRouteWithChildren,
290-
AuthenticatedRoute: AuthenticatedRoute,
291275
MyIndexRoute: MyIndexRoute,
292276
Oauth2RedirectIndexRoute: Oauth2RedirectIndexRoute,
293277
OnboardingGymIndexRoute: OnboardingGymIndexRoute,

src/routes/_authenticated.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/routes/my/-components/VideoDetailSwiper.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ export const VideoDetailSwiper = ({
213213
{items.map((item, index) => {
214214
const isActive = index === activeIndex;
215215
const isDownloading = downloadingIndex === index;
216-
const difficultyImageUrl = sample(item.gymLevelImageUrls);
216+
const difficultyImageUrl =
217+
item.gymLevelImageUrls[index % item.gymLevelImageUrls.length];
217218
return (
218219
<SwiperSlide key={`video-detail-slide-${item.id}`}>
219220
<div className="relative w-full h-dvh">

src/routes/my/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ function RouteComponent() {
161161
<div className="grid grid-cols-2 gap-x-2 gap-y-3 px-4">
162162
{flatItems.map((item, index) => {
163163
const key = `video-card-${index}`;
164-
const selectedDifficulty = sample(item.gymLevelImageUrls);
164+
const selectedDifficulty =
165+
item.gymLevelImageUrls[index % item.gymLevelImageUrls.length];
165166
return (
166167
<VideoCard
167168
key={key}

src/third-party/queryClient.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { QueryClient } from "@tanstack/react-query";
1+
import { QueryCache, QueryClient } from "@tanstack/react-query";
2+
import { AxiosError } from "axios";
3+
import { router } from "@/router";
24

35
export const customQueryClient = new QueryClient({
46
defaultOptions: {
@@ -7,4 +9,19 @@ export const customQueryClient = new QueryClient({
79
retry: 0,
810
},
911
},
12+
queryCache: new QueryCache({
13+
onError: (error) => {
14+
if (error instanceof AxiosError) {
15+
if (error.response?.status === 401) {
16+
router.navigate({ to: "/" });
17+
}
18+
if (error.response?.status === 302) {
19+
router.navigate({ to: "/" });
20+
}
21+
if (!error.response?.data) {
22+
router.navigate({ to: "/" });
23+
}
24+
}
25+
},
26+
}),
1027
});

0 commit comments

Comments
 (0)