1
0
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:
Matthias Kretschmann 2020-09-10 13:54:59 +02:00
parent 466f04c86d
commit acf233a77b
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 3 additions and 3 deletions

View File

@ -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>
) )
} }

View File

@ -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))
) )
} }