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

Preserve dark mode setting is not working properly #49

Open
vquelque opened this issue Oct 25, 2023 · 1 comment
Open

Preserve dark mode setting is not working properly #49

vquelque opened this issue Oct 25, 2023 · 1 comment

Comments

@vquelque
Copy link

Currently, the "preserve dark mode" setting is not working properly, even by uncommenting the required lines in main.js and darkMode.js
The reason is that the value used to set the darkMode key in darkMode.js::localStorage.setItem() should be this.isEnabled ? '1' : '0' instead of this.darkMode ? '1' : '0'.
Indeed, the darkMode ref does not exist.

// You can persist dark mode setting
// if (typeof localStorage !== 'undefined') {
// localStorage.setItem('darkMode', this.darkMode ? '1' : '0')
// }
}

@speightashley
Copy link

I second this. I can't get DarkMode to persist at all.

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

2 participants