Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 9 additions & 1 deletion apps/web/src/components/layout/header/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ const AccountHeader = () => {
? '계좌 수정'
: '계좌 관리';

const handleOnClick = () => {
if (pathname.includes('/create') || pathname.includes('/edit')) {
routes.push('/account');
} else {
Comment on lines +20 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): pathname.includes를 사용하면 경로 이름이 겹칠 경우 오탐지가 발생할 수 있습니다.

이 접근 방식은 '/create' 또는 '/edit'과 같은 부분 문자열을 포함하는 경로를 잘못 일치시킬 수 있습니다. 라우팅이 복잡하다면 더 엄격한 경로 확인을 고려하세요.

Original comment in English

issue (bug_risk): Using pathname.includes may lead to false positives if route names overlap.

This approach may incorrectly match routes containing '/create' or '/edit' as substrings. Consider a stricter path check if your routing is complex.

routes.push('/profile');
}
};

return (
<HeaderWrapper className="justify-start bg-white">
<Button variant="solid" color="transparent" onClick={() => routes.back()}>
<Button variant="solid" color="transparent" onClick={handleOnClick}>
<ChevronLeftIcon />
</Button>
<h2 className="text-h4 absolute left-1/2 -translate-x-1/2 font-bold">{title}</h2>
Expand Down
10 changes: 9 additions & 1 deletion apps/web/src/components/layout/header/address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ const AddressHeader = () => {
? '주소 수정'
: '주소 관리';

const handleOnClick = () => {
if (pathname.includes('/create') || pathname.includes('/edit')) {
routes.push('/address');
} else {
routes.push('/profile');
}
};

return (
<HeaderWrapper className="justify-start bg-white">
<Button variant="solid" color="transparent" onClick={() => routes.back()}>
<Button variant="solid" color="transparent" onClick={handleOnClick}>
<ChevronLeftIcon />
</Button>
<h2 className="text-h4 absolute left-1/2 -translate-x-1/2 font-bold">{title}</h2>
Expand Down
Loading