summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-10-07 08:31:50 -0400
committerChristopher Speller <crspeller@gmail.com>2015-10-07 08:31:50 -0400
commit08496a7c1498fc7c5588b70c9560f0abcd1739d8 (patch)
tree79baf0d7453485ca83afff42c818cb5124bb20c0 /web
parentcf9ce772c2d27e6d0c848d47c6bdb7aaa626abb4 (diff)
parent8de30c804f98a0aac381e16243cb52b3e3e63fcc (diff)
downloadchat-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')
-rw-r--r--web/react/stores/browser_store.jsx8
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) {