mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Refactored website ordering feature.
This commit is contained in:
parent
62dce0a8d1
commit
1d4aa7c535
96 changed files with 518 additions and 174 deletions
15
lib/web.js
15
lib/web.js
|
|
@ -61,10 +61,17 @@ export const setItem = (key, data, session) => {
|
|||
}
|
||||
};
|
||||
|
||||
export const getItem = (key, session) =>
|
||||
typeof window !== 'undefined'
|
||||
? JSON.parse((session ? sessionStorage : localStorage).getItem(key) || null)
|
||||
: null;
|
||||
export const getItem = (key, session) => {
|
||||
if (typeof window !== 'undefined') {
|
||||
const value = (session ? sessionStorage : localStorage).getItem(key);
|
||||
|
||||
if (value !== 'undefined') {
|
||||
return JSON.parse(value);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export const removeItem = (key, session) => {
|
||||
if (typeof window !== 'undefined') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue