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
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
src/app/components/Indicator/useOsVersion.tsx
which exports the custom useOsVersion hook with three states:osVersion
: variable which stores the version from the localStorageupdateOsVersion
: function which updates the OS version in the localStorageerror
: variable which stores the error message in case some error occured while accessing or updating the OS versionisQuotaExceededError
function