Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: library crashes when localStorage is not callable (#342)
Currently, we're checking for localStorage's presence but not its actual usability. In some scenarios, browsers can disallow `localStorage` to be called upon and in such cases, the library will hard crash. In this change, I added a catch statement to intercept these errors and return an empty string when `localStorage` cannot be called upon. - [X] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [X] I have used ESLint & Prettier to follow the code style of this project. - [X] I have updated the documentation accordingly. - [X] I have added tests to cover my changes. - [X] All new and existing tests passed.
- Loading branch information