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(getSavedConfig): catch window.localStorage error #161

Conversation

nbrustein
Copy link
Contributor

Fixes #124

try {
hasLocalStorage = !!$window.localStorage;
} catch (_error) {
error = _error;

Choose a reason for hiding this comment

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

Unused variable?

My suggestion is throw an error, console.warn also would be helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Which unused variable do you mean? If you mean the 'error', it seemed like coffeescript required that. I'm no good at coffeescript, so I my have done it wrong.
  2. I def don't want to throw an error, since the whole point of this PR is to suppress the error.
  3. I don't think a console.warn is necessary. This library is supposed to support situations with no local storage, so it does not really require a warning, IMO.

@booleanbetrayal
Copy link
Collaborator

Privacy mode, etc is a completely valid use case for a browser to be running in, so I don't think it should warn or anything. Just fall back accordingly. lgtm!

booleanbetrayal added a commit that referenced this pull request Jun 16, 2015
fix(getSavedConfig): catch window.localStorage error
@booleanbetrayal booleanbetrayal merged commit 60b9818 into lynndylanhurley:master Jun 16, 2015
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