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

Abstract localStorage interactions into a custom Hook #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Agnish1611
Copy link

@Agnish1611 Agnish1611 commented Jul 17, 2024

Description
This PR creates a custom Hook called useOsVersion to abstract the localStorage interactions. The logic for accessing and updating the OS version has been encapsulated into this hook #125

Changes

  • Created a new file src/app/components/Indicator/useOsVersion.tsx which exports the custom useOsVersion hook with three states:
    • osVersion: variable which stores the version from the localStorage
    • updateOsVersion: function which updates the OS version in the localStorage
    • error: variable which stores the error message in case some error occured while accessing or updating the OS version
  • The error handling specifically handles the quota exceeded error using the isQuotaExceededError function

@Arindam200
Copy link
Contributor

Hey @Agnish1611 , this issue is already being worked on #130 ,

However, I would recommend that you collaborate there and probably review that PR.

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.

2 participants