diff options
Diffstat (limited to 'webapp/stores/browser_store.jsx')
-rw-r--r-- | webapp/stores/browser_store.jsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/webapp/stores/browser_store.jsx b/webapp/stores/browser_store.jsx index 18fcc452d..a7c5294cd 100644 --- a/webapp/stores/browser_store.jsx +++ b/webapp/stores/browser_store.jsx @@ -6,8 +6,8 @@ import * as Utils from 'utils/utils.jsx'; import {Constants, ErrorPageTypes} from 'utils/constants.jsx'; function getPrefix() { - if (global.window.mm_current_user_id) { - return global.window.mm_current_user_id + '_'; + if (global.mm_user) { + return global.mm_user.id + '_'; } console.warn('BrowserStore tried to operate without user present'); //eslint-disable-line no-console @@ -50,6 +50,7 @@ class BrowserStoreClass { getGlobalItem(name, defaultValue = null) { var result = null; + try { if (this.isLocalStorageSupported()) { result = JSON.parse(localStorage.getItem(name)); @@ -60,7 +61,7 @@ class BrowserStoreClass { result = null; } - if (!result) { + if (typeof result === 'undefined' || result === null) { result = defaultValue; } |