From 2c34dca347039b5ce992f56d826f3bb00e58532b Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Thu, 15 Jun 2023 17:53:26 +0530 Subject: [PATCH] fix: `NS_ERROR_STORAGE_BUSY` warnings in firefox (#7319) Fixes: https://linear.app/chatwoot/issue/CW-2075/ns-error-storage-busy-no-error-message --- app/javascript/shared/helpers/localStorage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/shared/helpers/localStorage.js b/app/javascript/shared/helpers/localStorage.js index 9f46c48ca..2c002bd5c 100644 --- a/app/javascript/shared/helpers/localStorage.js +++ b/app/javascript/shared/helpers/localStorage.js @@ -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;