mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-15 09:44:53 +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}
|
defaultChecked={debug === true}
|
||||||
onChange={() => setDebug(!debug)}
|
onChange={() => setDebug(!debug)}
|
||||||
/>
|
/>
|
||||||
<FormHelp>Show geeky debug information in some places.</FormHelp>
|
<FormHelp>Show geeky information in some places.</FormHelp>
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -22,14 +22,14 @@ const localStorageKey = 'ocean-user-preferences'
|
|||||||
|
|
||||||
function getLocalStorage() {
|
function getLocalStorage() {
|
||||||
const storageParsed =
|
const storageParsed =
|
||||||
window !== undefined &&
|
typeof window !== undefined &&
|
||||||
JSON.parse(window.localStorage.getItem(localStorageKey))
|
JSON.parse(window.localStorage.getItem(localStorageKey))
|
||||||
return storageParsed
|
return storageParsed
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLocalStorage(values: UserPreferencesValue) {
|
function setLocalStorage(values: UserPreferencesValue) {
|
||||||
return (
|
return (
|
||||||
window !== undefined &&
|
typeof window !== undefined &&
|
||||||
window.localStorage.setItem(localStorageKey, JSON.stringify(values))
|
window.localStorage.setItem(localStorageKey, JSON.stringify(values))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user