Skip to content

Commit ddf3a75

Browse files
committed
fix: 사이드 바에서 토픽 활성화 로직 수정
1 parent 482dfee commit ddf3a75

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/web/src/components/(with-side-bar)/layout/recent-topic-list.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ export default function RecentTopicList() {
3232
close(); // 모바일에서 사이드바 닫기
3333
};
3434

35-
const isSelected = (topicId: number) =>
36-
pathname.includes("topic") && pathname.includes(topicId.toString());
35+
const isSelected = (topicId: number) => {
36+
const topicPath = `/topic/${topicId}`;
37+
return pathname === topicPath || pathname.startsWith(`${topicPath}/`);
38+
};
3739

3840
useEffect(() => {
3941
if (!isPending) {

0 commit comments

Comments
 (0)