mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-15 06:45:36 +08:00
fix(config): options are not getting reflected in fav light/dark theme select, closes #1079
This commit is contained in:
parent
f2578c958d
commit
ae1158d957
@ -27,6 +27,13 @@ export const App: ParentComponent = ({ children }) => {
|
|||||||
const prefersDark = usePrefersDark()
|
const prefersDark = usePrefersDark()
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
|
console.log(
|
||||||
|
autoSwitchTheme(),
|
||||||
|
prefersDark(),
|
||||||
|
favNightTheme(),
|
||||||
|
favDayTheme(),
|
||||||
|
)
|
||||||
|
|
||||||
if (autoSwitchTheme())
|
if (autoSwitchTheme())
|
||||||
setCurTheme(prefersDark() ? favNightTheme() : favDayTheme())
|
setCurTheme(prefersDark() ? favNightTheme() : favDayTheme())
|
||||||
})
|
})
|
||||||
|
@ -492,13 +492,16 @@ const ConfigForXd = () => {
|
|||||||
<ConfigTitle>{t('favDayTheme')}</ConfigTitle>
|
<ConfigTitle>{t('favDayTheme')}</ConfigTitle>
|
||||||
|
|
||||||
<Select
|
<Select
|
||||||
value={favDayTheme()}
|
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setFavDayTheme(e.target.value as (typeof themes)[number])
|
setFavDayTheme(e.target.value as (typeof themes)[number])
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<For each={themes}>
|
<For each={themes}>
|
||||||
{(theme) => <option value={theme}>{theme}</option>}
|
{(theme) => (
|
||||||
|
<option selected={favDayTheme() === theme} value={theme}>
|
||||||
|
{theme}
|
||||||
|
</option>
|
||||||
|
)}
|
||||||
</For>
|
</For>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
@ -507,13 +510,16 @@ const ConfigForXd = () => {
|
|||||||
<ConfigTitle>{t('favNightTheme')}</ConfigTitle>
|
<ConfigTitle>{t('favNightTheme')}</ConfigTitle>
|
||||||
|
|
||||||
<Select
|
<Select
|
||||||
value={favNightTheme()}
|
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setFavNightTheme(e.target.value as (typeof themes)[number])
|
setFavNightTheme(e.target.value as (typeof themes)[number])
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<For each={themes}>
|
<For each={themes}>
|
||||||
{(theme) => <option value={theme}>{theme}</option>}
|
{(theme) => (
|
||||||
|
<option selected={favNightTheme() === theme} value={theme}>
|
||||||
|
{theme}
|
||||||
|
</option>
|
||||||
|
)}
|
||||||
</For>
|
</For>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user