1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

undefined is hard

This commit is contained in:
Matthias Kretschmann 2020-09-10 14:27:48 +02:00
parent e421667941
commit 69afec8511
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -20,14 +20,14 @@ const localStorageKey = 'ocean-user-preferences'
function getLocalStorage() {
const storageParsed =
typeof window !== undefined &&
typeof window !== 'undefined' &&
JSON.parse(window.localStorage.getItem(localStorageKey))
return storageParsed
}
function setLocalStorage(values: UserPreferencesValue) {
return (
typeof window !== undefined &&
typeof window !== 'undefined' &&
window.localStorage.setItem(localStorageKey, JSON.stringify(values))
)
}