fix: update sidebar button active state logic

This commit is contained in:
codytseng 2025-10-20 10:00:18 +08:00
parent 6090c01965
commit 09c05cc62a
6 changed files with 12 additions and 12 deletions

View file

@ -5,7 +5,7 @@ import { Settings } from 'lucide-react'
import SidebarItem from './SidebarItem'
export default function SettingsButton({ collapse }: { collapse: boolean }) {
const { current, navigate } = usePrimaryPage()
const { current, navigate, display } = usePrimaryPage()
const { push } = useSecondaryPage()
const { enableSingleColumnLayout } = useUserPreferences()
@ -14,7 +14,7 @@ export default function SettingsButton({ collapse }: { collapse: boolean }) {
title="Settings"
onClick={() => (enableSingleColumnLayout ? navigate('settings') : push(toSettings()))}
collapse={collapse}
active={current === 'settings'}
active={display && current === 'settings'}
>
<Settings />
</SidebarItem>