mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-15 01:34:57 +01:00
copy, window check
This commit is contained in:
parent
466f04c86d
commit
acf233a77b
@ -15,7 +15,7 @@ export default function Debug(): ReactElement {
|
||||
defaultChecked={debug === true}
|
||||
onChange={() => setDebug(!debug)}
|
||||
/>
|
||||
<FormHelp>Show geeky debug information in some places.</FormHelp>
|
||||
<FormHelp>Show geeky information in some places.</FormHelp>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
@ -22,14 +22,14 @@ const localStorageKey = 'ocean-user-preferences'
|
||||
|
||||
function getLocalStorage() {
|
||||
const storageParsed =
|
||||
window !== undefined &&
|
||||
typeof window !== undefined &&
|
||||
JSON.parse(window.localStorage.getItem(localStorageKey))
|
||||
return storageParsed
|
||||
}
|
||||
|
||||
function setLocalStorage(values: UserPreferencesValue) {
|
||||
return (
|
||||
window !== undefined &&
|
||||
typeof window !== undefined &&
|
||||
window.localStorage.setItem(localStorageKey, JSON.stringify(values))
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user