Fix tracker build.

This commit is contained in:
Mike Cao 2022-03-02 12:10:47 -08:00
parent 373dbf50ba
commit 6ea6e2e27d
2 changed files with 2 additions and 12 deletions

View file

@ -61,17 +61,9 @@ export const setItem = (key, data, session) => {
}
};
function tryParse(value) {
try {
return JSON.parse(value);
} catch {
return undefined;
}
}
export const getItem = (key, session) =>
typeof window !== 'undefined'
? tryParse((session ? sessionStorage : localStorage).getItem(key))
? JSON.parse((session ? sessionStorage : localStorage).getItem(key) || null)
: null;
export const removeItem = (key, session) => {