diff options
Diffstat (limited to 'web/react/stores/browser_store.jsx')
-rw-r--r-- | web/react/stores/browser_store.jsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/web/react/stores/browser_store.jsx b/web/react/stores/browser_store.jsx index e45d3d981..27a74fb2b 100644 --- a/web/react/stores/browser_store.jsx +++ b/web/react/stores/browser_store.jsx @@ -41,7 +41,13 @@ class BrowserStoreClass { } setGlobalItem(name, value) { - localStorage.setItem(name, JSON.stringify(value)); + try { + localStorage.setItem(name, JSON.stringify(value)); + } catch (err) { + console.log('An error occurred while setting local storage, clearing all props'); //eslint-disable-line no-console + localStorage.clear(); + window.location.href = window.location.href; + } } getGlobalItem(name, defaultValue) { |