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(useLocalStorage, useSessionStorage): replace hook with noop in case of storage absence. #540

Merged
merged 2 commits into from
Jan 11, 2022

Conversation

xobotyi
Copy link
Contributor

@xobotyi xobotyi commented Dec 23, 2021

How does this PR fix the problem?

Adds storage access check to replace hook with noop functionality.

Checklist

  • Have you read contribution guideline?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Is there an existing issue for this PR?
  • Have the files been linted and formatted?
  • Have the docs been updated to match the changes in the PR?
  • Have the tests been updated to match the changes in the PR?
  • Have you run the tests locally to confirm they pass?

@xobotyi xobotyi added the 🕯️ bug fix One or more bugs fixed label Dec 23, 2021
@xobotyi xobotyi requested a review from JoeDuncko December 23, 2021 14:53
@xobotyi xobotyi self-assigned this Dec 23, 2021
@codecov
Copy link

codecov bot commented Dec 23, 2021

Codecov Report

Merging #540 (c33ce06) into master (66655b7) will decrease coverage by 0.25%.
The diff coverage is 90.90%.

Impacted file tree graph

@@             Coverage Diff             @@
##            master     #540      +/-   ##
===========================================
- Coverage   100.00%   99.74%   -0.26%     
===========================================
  Files           44       44              
  Lines          778      792      +14     
  Branches       140      152      +12     
===========================================
+ Hits           778      790      +12     
- Partials         0        2       +2     
Impacted Files Coverage Δ
src/useLocalStorageValue/useLocalStorageValue.ts 91.66% <90.90%> (-8.34%) ⬇️
...c/useSessionStorageValue/useSessionStorageValue.ts 91.66% <90.90%> (-8.34%) ⬇️
src/useMeasure/useMeasure.ts 100.00% <0.00%> (ø)
src/useResizeObserver/useResizeObserver.ts 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66655b7...c33ce06. Read the comment docs.

@xobotyi
Copy link
Contributor Author

xobotyi commented Jan 10, 2022

@JoeDuncko recheck if issue still present please

@xobotyi xobotyi merged commit 790b302 into master Jan 11, 2022
@xobotyi xobotyi deleted the refs/for/fix-521 branch January 11, 2022 08:35
github-actions bot pushed a commit that referenced this pull request Jan 11, 2022
## [12.1.1](v12.1.0...v12.1.1) (2022-01-11)

### Bug Fixes

* **`useLocalStorage`, `useSessionStorage`:** replace hook with noop in case of storage absence. ([#540](#540)) ([790b302](790b302)), closes [#521](#521)
@xobotyi
Copy link
Contributor Author

xobotyi commented Jan 11, 2022

🎉 This PR is included in version 12.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@JoeDuncko
Copy link
Contributor

I know it's a bit late, but I wanted to make sure to note that this fixed the problem. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕯️ bug fix One or more bugs fixed released
Development

Successfully merging this pull request may close these issues.

2 participants