diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-10-07 08:31:50 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-10-07 08:31:50 -0400 |
commit | 08496a7c1498fc7c5588b70c9560f0abcd1739d8 (patch) | |
tree | 79baf0d7453485ca83afff42c818cb5124bb20c0 /web/react | |
parent | cf9ce772c2d27e6d0c848d47c6bdb7aaa626abb4 (diff) | |
parent | 8de30c804f98a0aac381e16243cb52b3e3e63fcc (diff) | |
download | chat-08496a7c1498fc7c5588b70c9560f0abcd1739d8.tar.gz chat-08496a7c1498fc7c5588b70c9560f0abcd1739d8.tar.bz2 chat-08496a7c1498fc7c5588b70c9560f0abcd1739d8.zip |
Merge pull request #949 from mattermost/PLT-478
PLT-478 partial fix for local storage getting filled up. This will b…
Diffstat (limited to 'web/react')
-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) { |