This commit is contained in:
2025-11-02 20:50:49 -07:00
parent 3c05196dda
commit 2d764448af
12 changed files with 58 additions and 16 deletions

View File

@@ -8,10 +8,12 @@ import { useGlobal } from '../GlobalProvider'
export default function Settings () {
const [allowNotifications, setAllowNotifications] = useState(false)
const [alwaysShowGamesInSidebar, setAlwaysShowGamesInSidebar] =
useState(false)
const [useWineOnUnixWhenNeeded, setUseWineOnUnixWhenNeeded] = useState(false)
const [wineOnUnixCommand, setWineOnUnixCommand] = useState('wine %path%')
const [loaded, setLoaded] = useState(false)
const { normalConfig } = useGlobal()
const { normalConfig, setNormalConfig } = useGlobal()
useEffect(() => {
;(async () => {
@@ -21,6 +23,9 @@ export default function Settings () {
)
setWineOnUnixCommand(normalConfig.settings.wineOnUnixCommand)
setAllowNotifications(normalConfig.settings.allowNotifications)
setAlwaysShowGamesInSidebar(
normalConfig.settings.alwaysShowGamesInSidebar
)
setLoaded(true)
break
}
@@ -44,6 +49,30 @@ export default function Settings () {
}
}}
/>
<Setting
label='Always show games in sidebar'
value={alwaysShowGamesInSidebar}
onChange={async () => {
while (normalConfig != null) {
setAlwaysShowGamesInSidebar(!alwaysShowGamesInSidebar)
setNormalConfig({
...normalConfig,
settings: {
...normalConfig.settings,
alwaysShowGamesInSidebar: !alwaysShowGamesInSidebar
}
})
writeNormalConfig({
...normalConfig,
settings: {
...normalConfig.settings,
alwaysShowGamesInSidebar: !alwaysShowGamesInSidebar
}
})
break
}
}}
/>
<Setting
label='Use wine to launch Berry Dash when needed'
value={useWineOnUnixWhenNeeded}