diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-07-08 12:38:14 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-07-08 12:38:14 -0400 |
commit | d5785ee9017aedbe6410f23486660fa6ec948c23 (patch) | |
tree | e040228363ec18c15a9b619756318d16dfceb39f /web/react/stores/user_store.jsx | |
parent | 7f5ebb42b5712460fd29fb086b0734ccba1aacd9 (diff) | |
download | chat-d5785ee9017aedbe6410f23486660fa6ec948c23.tar.gz chat-d5785ee9017aedbe6410f23486660fa6ec948c23.tar.bz2 chat-d5785ee9017aedbe6410f23486660fa6ec948c23.zip |
Finishing centralization of BrowserStore
Diffstat (limited to 'web/react/stores/user_store.jsx')
-rw-r--r-- | web/react/stores/user_store.jsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/web/react/stores/user_store.jsx b/web/react/stores/user_store.jsx index 01f0c8c8c..e832b34c7 100644 --- a/web/react/stores/user_store.jsx +++ b/web/react/stores/user_store.jsx @@ -65,12 +65,12 @@ var UserStore = assign({}, EventEmitter.prototype, { }, setCurrentId: function(id) { if (id == null) - localStorage.removeItem("current_user_id"); + BrowserStore.removeGlobalItem("current_user_id"); else - localStorage.setItem("current_user_id", id); + BrowserStore.setGlobalItem("current_user_id", id); }, getCurrentId: function(skipFetch) { - var current_id = localStorage.getItem("current_user_id"); + var current_id = BrowserStore.getGlobalItem("current_user_id"); // this is a speical case to force fetch the // current user if it's missing @@ -153,17 +153,17 @@ var UserStore = assign({}, EventEmitter.prototype, { this._storeProfiles(ps); }, _storeProfiles: function(profiles) { - localStorage.setItem("profiles", JSON.stringify(profiles)); + BrowserStore.setGlobalItem("profiles", JSON.stringify(profiles)); var profileUsernameMap = {}; for (var id in profiles) { profileUsernameMap[profiles[id].username] = profiles[id]; } - localStorage.setItem("profileUsernameMap", JSON.stringify(profileUsernameMap)); + BrowserStore.setGlobalItem("profileUsernameMap", JSON.stringify(profileUsernameMap)); }, _getProfiles: function() { var profiles = {}; try { - profiles = JSON.parse(localStorage.getItem("profiles")); + profiles = JSON.parse(BrowserStore.getGlobalItem("profiles")); } catch (err) { } @@ -177,7 +177,7 @@ var UserStore = assign({}, EventEmitter.prototype, { _getProfilesUsernameMap: function() { var profileUsernameMap = {}; try { - profileUsernameMap = JSON.parse(localStorage.getItem("profileUsernameMap")); + profileUsernameMap = JSON.parse(BrowserStore.getGlobalItem("profileUsernameMap")); } catch (err) { } |