Skip to content

Commit 91d1cbf

Browse files
authored
[25.02.25] Fix - Dev 브랜치 최신화 (#15)
* [25.02.16 / TASK-118] Feature: 채널톡 추가 및 헤더 로고 클릭 동작 추가 (#13) * hotfix: 일부 오류 수정 username 관련 오류 및 SSR 렌더린 관련 오류로 추정되는 오류 수정 * feat: 채널톡 추가 및 헤더 로고 동작 추가 * refactor: console.log 제거 * refactor: 메세지 내용 변경 * refactor: 코멘트 반영 겸 자잘한 오류 해결 * refactor: username 관련 코드 수정 * refactor: ENV 오류 전용 공통 오류 객체 추가 * hotfix: env 값 추가 * hotfix: env 관련 오류 해결 * hotfix: 구조분해 관련 오류 해결 * hotfix: 겹친 코드 제거
1 parent 72ed6e3 commit 91d1cbf

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

src/app/(with-tracker)/(auth-required)/layout.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ReactElement } from 'react';
22
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
3+
import { Header } from '@/components';
34
import { PATHS } from '@/constants';
45
import { me } from '@/apis';
56
import { getQueryClient } from '@/utils/queryUtil';

src/components/auth-required/header/index.tsx

+7-15
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,17 @@ export const Header = () => {
3535
const barWidth = width < SCREENS.MBI ? 65 : 180;
3636
const client = useQueryClient();
3737

38-
const { data: profiles } = useQuery({
39-
queryKey: [PATHS.ME],
40-
queryFn: me,
41-
});
42-
4338
const { mutate: out } = useMutation({
4439
mutationFn: logout,
45-
onSuccess: async () => {
46-
client
47-
.getQueryCache()
48-
.findAll()
49-
.forEach((query) => {
50-
client.setQueryData(query.queryKey, null);
51-
});
52-
client.clear();
53-
router.replace('/');
54-
},
40+
onMutate: () => router.replace('/'),
41+
onSuccess: () => client.removeQueries(),
5542
});
5643

44+
const { data: profiles } = useQuery({
45+
queryKey: [PATHS.ME],
46+
queryFn: me,
47+
});
48+
5749
useEffect(() => {
5850
const handleClickOutside = (e: MouseEvent) =>
5951
open &&

0 commit comments

Comments
 (0)