8000 Theme does not change on first toggle · Issue #1337 · slskd/slskd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Theme does not change on first toggle #1337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
evanrh opened this issue Apr 22, 2025 & 79CE middot; 0 comments
Open

Theme does not change on first toggle #1337

evanrh opened this issue Apr 22, 2025 · 0 comments

Comments

@evanrh
Copy link
evanrh commented Apr 22, 2025

When clicking the theme button initially, there is no saved value, and the theme does not toggle. The state is fixed after this though, and clicking it again will toggle the theme correctly.

This can be tested by clearing any site data for a running instance and then clicking the theme toggle.

The issue looks to be here:

theme = this.getSavedTheme() ||
(window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'light'),

This doesn't actually update the component's state, and I think it should go in initialState instead.

If y'all want, I'm happy to make and test this change 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0