-
-
Notifications
You must be signed in to change notification settings - Fork 149
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: localStorage availability check update #588
fix: localStorage availability check update #588
Conversation
@iuriizaporozhets is attempting to deploy a commit to the 47ng Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
I see an issue with the current way it's implemented: if a client has a localStorage value under the test
key, it would get cleared by what should otherwise be an idempotent function.
One alternative would be to read the value before attempting a write, and restore it at the end, or use a more specifically-named key, which won't cause collisions.
fix: formatting and naming fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
🎉 This PR is included in version 1.17.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
When in Safari set Block All cookies then local storage also will not work. But window.localStorage object itself will be available and when we will try set or get something from local storage we will get
SecurityError: The operation is insecure.
error and it is crashing the application for users with disabled cookies and local storage.