Fix STORAGE_BUSY error in firefox

This commit is contained in:
Muhsin Keloth 2023-06-15 16:30:48 +05:30
parent b1828d462d
commit a68e736cfc

View File

@ -4,11 +4,11 @@ export const LocalStorage = {
},
get(key) {
const value = window.localStorage.getItem(key);
try {
const value = window.localStorage.getItem(key);
return typeof value === 'string' ? JSON.parse(value) : value;
} catch (error) {
return value;
return undefined;
}
},
set(key, value) {