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

Use default theme if localstorage value deleted manually #45

Merged
merged 1 commit into from
Jun 14, 2021

Conversation

DavidWells
Copy link
Contributor

Hey thanks for the project 😃

When you (or a user) deletes the localStorage value manually via dev tools or otherwise, the value is set as null and no themes are used.

Example:

null being set

It seems like this should revert to defaultValue if it's set in the provider and never be set to null.

@DavidWells DavidWells changed the title If default theme set, use it if localstorage === null (happens on loc… U default theme if localstorage value deleted manually May 29, 2021
@DavidWells DavidWells changed the title U default theme if localstorage value deleted manually Use default theme if localstorage value deleted manually May 29, 2021
Copy link
Owner

@pacocoursey pacocoursey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix, thank you!

@pacocoursey pacocoursey merged commit 01a6a2b into pacocoursey:master Jun 14, 2021
@iansu
Copy link

iansu commented Jun 26, 2021

I just ran into this same bug. It looks like a new version with this fix hasn't been published yet. Any chance you could release it soon? This is a great library. Thanks for all your work on it!

@pacocoursey
Copy link
Owner

Sorry for the delay, just published 0.0.15 with this fix :)

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

Successfully merging this pull request may close these issues.

3 participants