summaryrefslogtreecommitdiffstats
path: root/web/react/stores
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/stores')
-rw-r--r--web/react/stores/browser_store.jsx8
-rw-r--r--web/react/stores/socket_store.jsx6
2 files changed, 11 insertions, 3 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) {
diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx
index 1d853f979..9f354965e 100644
--- a/web/react/stores/socket_store.jsx
+++ b/web/react/stores/socket_store.jsx
@@ -50,8 +50,10 @@ class SocketStoreClass extends EventEmitter {
}
this.failCount = 0;
- ErrorStore.storeLastError(null);
- ErrorStore.emitChange();
+ if (ErrorStore.getLastError()) {
+ ErrorStore.storeLastError(null);
+ ErrorStore.emitChange();
+ }
};
conn.onclose = () => {