Skip to content
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

Lightswitch first render issues #362

Closed
niktek opened this issue Oct 13, 2022 · 4 comments · Fixed by #366
Closed

Lightswitch first render issues #362

niktek opened this issue Oct 13, 2022 · 4 comments · Fixed by #366
Labels
bug Something isn't working

Comments

@niktek
Copy link
Contributor

niktek commented Oct 13, 2022

Current Behavior

On initial page load the icon in the switch doesn't render until after an interaction and it defaults into the Light mode even if the user system preference is set to Dark mode.

Steps To Reproduce

Brave and Safari in private mode
Open Theme drop down menu

image

Anything else?

No response

@niktek niktek added the bug Something isn't working label Oct 13, 2022
@endigo9740
Copy link
Contributor

There was two issues for this:

  1. The theme colors were not being applied consistently because the state was not set properly for the defaults (system preference)
  2. The LightSwitch store value was not being updated until interacted with, so by default when using the system preference, the value was undefined rather than a boolean.

Both have been fixed and will go live with the QA branch I've created.

@endigo9740 endigo9740 linked a pull request Oct 14, 2022 that will close this issue
4 tasks
@Zerdayne
Copy link

Zerdayne commented Jan 26, 2023

Something similar is still happening. I'm using this in a tauri application.

$: {
    console.log($storePrefersDarkScheme);
    console.log($storeLightSwitch);
}

will log true for both.

The visualization I get after starting the application:
image
with the light theme in the full application applied.

Clicking once the switch fixes the visualization of the switch (switch button is left, sun icon is showing). Clicking twice activates the dark theme. At this point the switch works perfectly fine.

@cappscolton
Copy link

Something similar is still happening. I'm using this in a tauri application.

$: {
    console.log($storePrefersDarkScheme);
    console.log($storeLightSwitch);
}

will log true for both.

The visualization I get after starting the application: image with the light theme in the full application applied.

Clicking once the switch fixes the visualization of the switch (switch button is left, sun icon is showing). Clicking twice activates the dark theme. At this point the switch works perfectly fine.

did you ever find a fix for this secondary issue? seems to still be around in tauri projects.

@endigo9740
Copy link
Contributor

endigo9740 commented May 5, 2023

@cappscolton you might read through this PR and the related issue. Seems like this might fix this?

This will come as part of next week's release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants