fix: NS_ERROR_STORAGE_BUSY warnings in firefox (#7319)

Fixes: https://linear.app/chatwoot/issue/CW-2075/ns-error-storage-busy-no-error-message
This commit is contained in:
Muhsin Keloth
2023-06-15 17:53:26 +05:30
committed by GitHub
parent 69b9123963
commit 2c34dca347

View File

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