fix ssr
This commit is contained in:
parent
2e67f911c1
commit
0f610d3c18
11 changed files with 408 additions and 288 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
export const getAllLocalStorageItems = (): Record<string, string | null> => {
|
||||
const allData: Record<string, string | null> = {};
|
||||
|
||||
if (typeof localStorage !== 'undefined') {
|
||||
for (let i = 0; i < localStorage.length; i++) {
|
||||
const key = localStorage.key(i);
|
||||
if (key) {
|
||||
|
@ -10,6 +10,7 @@ export const getAllLocalStorageItems = (): Record<string, string | null> => {
|
|||
allData[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return allData;
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue