Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/hooks/useHeaderNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { tripDetailStore } from "@/store/client/tripDetailStore";
import { createTripStore } from "@/store/client/createTripStore";
import { editTripStore } from "@/store/client/editTripStore";
import { userProfileOverlayStore } from "@/store/client/userProfileOverlayStore";
import { authStore } from "@/store/client/authStore";

const ROUTES = {
REGISTER: "/register",
Expand Down Expand Up @@ -77,7 +78,8 @@ export const useHeaderNavigation = () => {
const router = useTransitionRouter();
const { resetCreateTripDetail } = createTripStore();
const { resetEditTripDetail } = editTripStore();
const { setProfileShow } = userProfileOverlayStore();
const { userId } = authStore();
const { setProfileShow, userProfileUserId } = userProfileOverlayStore();
const {
searchTravel,
setSearchTravel,
Expand Down Expand Up @@ -391,15 +393,20 @@ export const useHeaderNavigation = () => {
condition: () => checkRoute.exact(ROUTES.USER_PROFILE_BADGE),
action: () => {
router.back();
setTimeout(() => setProfileShow(true), 100);
if (userProfileUserId !== userId) {
// 마이페이지가 아닌 페이지에서 접속 했을시, 뒤로 가기 해도 프로필 overlay화면
setTimeout(() => setProfileShow(true), 100);
}
},
},
{
// 상대방 프로필 화면의 여행 로그 화면,
condition: () => checkRoute.exact(ROUTES.USER_TRAVEL_LOG),
action: () => {
router.back();
setTimeout(() => setProfileShow(true), 100);
if (userProfileUserId !== userId) {
setTimeout(() => setProfileShow(true), 100);
}
},
},
];
Expand Down