summaryrefslogtreecommitdiffstats
path: root/webapp/stores/browser_store.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/stores/browser_store.jsx')
-rw-r--r--webapp/stores/browser_store.jsx28
1 files changed, 20 insertions, 8 deletions
diff --git a/webapp/stores/browser_store.jsx b/webapp/stores/browser_store.jsx
index 9acd8530c..4b8bae06b 100644
--- a/webapp/stores/browser_store.jsx
+++ b/webapp/stores/browser_store.jsx
@@ -20,6 +20,11 @@ function getPrefix() {
}
class BrowserStoreClass {
+ constructor() {
+ this.hasCheckedLocalStorage = false;
+ this.localStorageSupported = false;
+ }
+
setItem(name, value) {
this.setGlobalItem(getPrefix() + name, value);
}
@@ -145,6 +150,7 @@ class BrowserStoreClass {
const logoutId = sessionStorage.getItem('__logout__');
const serverVersion = this.getLastServerVersion();
const landingPageSeen = this.hasSeenLandingPage();
+ const selectedTeams = this.getItem('selected_teams');
sessionStorage.clear();
localStorage.clear();
@@ -160,23 +166,27 @@ class BrowserStoreClass {
if (landingPageSeen) {
this.setLandingPageSeen(landingPageSeen);
}
+
+ if (selectedTeams) {
+ this.setItem('selected_teams', selectedTeams);
+ }
}
isLocalStorageSupported() {
- if (this.checkedLocalStorageSupported !== '') {
- return this.checkedLocalStorageSupported;
+ if (this.hasCheckedLocalStorage) {
+ return this.localStorageSupported;
}
+ this.localStorageSupported = false;
+
try {
localStorage.setItem('__testLocal__', '1');
- if (localStorage.getItem('__testLocal__') !== '1') {
- this.checkedLocalStorageSupported = false;
+ if (localStorage.getItem('__testLocal__') === '1') {
+ this.localStorageSupported = true;
}
localStorage.removeItem('__testLocal__', '1');
-
- this.checkedLocalStorageSupported = true;
} catch (e) {
- this.checkedLocalStorageSupported = false;
+ this.localStorageSupported = false;
}
try {
@@ -187,7 +197,9 @@ class BrowserStoreClass {
browserHistory.push(window.location.origin + '/error?title=' + notSupportedParams.title + '&message=' + notSupportedParams.message);
}
- return this.checkedLocalStorageSupported;
+ this.hasCheckedLocalStorage = true;
+
+ return this.localStorageSupported;
}
hasSeenLandingPage() {