Merge pull request #949 from mattermost/PLT-478

PLT-478 partial fix for local storage getting filled up.  This will b…
This commit is contained in:
Christopher Speller
2015-10-07 08:31:50 -04:00

View File

@@ -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) {