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

Fix reading of start_paused localStorage #37

Merged
merged 1 commit into from
Oct 2, 2017
Merged

Fix reading of start_paused localStorage #37

merged 1 commit into from
Oct 2, 2017

Conversation

slokhorst
Copy link

@slokhorst slokhorst commented Oct 1, 2017

Booleans are stored in localStorage as strings. And since Boolean("false") == true, this would cause localStorage.start_paused to be misinterpreted.

If we implement #22 this would no longer be an issue, as chrome.strorage can store booleans (and other objects). Another option would be to wrap localStorage with JSON.stringify() on store and JSON.parse() on load. I'm not sure what the other (dis)advantages of chrome.storage are.

That would allow us to remove all these ugly and error-prone === 'true' comparisons.

@slokhorst slokhorst changed the title Fix reading of booleans from localStorage Fix reading of start_paused localStorage Oct 1, 2017
@YodaDaCoda
Copy link
Owner

Thanks for this. I really want to get chrome.storage implemented and this will have to do until I have time to do that.

@YodaDaCoda YodaDaCoda merged commit 980c42a into YodaDaCoda:master Oct 2, 2017
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.

None yet

2 participants