mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Fix tracker build.
This commit is contained in:
parent
373dbf50ba
commit
6ea6e2e27d
2 changed files with 2 additions and 12 deletions
10
lib/web.js
10
lib/web.js
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue