diff options
author | nickago <ngonella@calpoly.edu> | 2015-08-06 11:05:13 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-08-06 11:44:13 -0700 |
commit | 3815ab806585afa205c074c0b40ddc31e4314190 (patch) | |
tree | eb606b7763f70f0c5171716e9f4d0405f193714c /web/react/stores | |
parent | 3f987db4a5a3aacbe40ad6105e55341355ff0943 (diff) | |
download | chat-3815ab806585afa205c074c0b40ddc31e4314190.tar.gz chat-3815ab806585afa205c074c0b40ddc31e4314190.tar.bz2 chat-3815ab806585afa205c074c0b40ddc31e4314190.zip |
Added keys to array-based elements and made getMe asynchronous
Diffstat (limited to 'web/react/stores')
-rw-r--r-- | web/react/stores/user_store.jsx | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/web/react/stores/user_store.jsx b/web/react/stores/user_store.jsx index aff5a0bed..85cb4c9ee 100644 --- a/web/react/stores/user_store.jsx +++ b/web/react/stores/user_store.jsx @@ -4,7 +4,6 @@ var AppDispatcher = require('../dispatcher/app_dispatcher.jsx'); var EventEmitter = require('events').EventEmitter; var assign = require('object-assign'); -var client = require('../utils/client.jsx'); var Constants = require('../utils/constants.jsx'); var ActionTypes = Constants.ActionTypes; @@ -73,24 +72,13 @@ var UserStore = assign({}, EventEmitter.prototype, { BrowserStore.setGlobalItem("current_user_id", id); } }, - getCurrentId: function(skipFetch) { + getCurrentId: function() { var current_id = this._current_id; if (current_id == null) { current_id = BrowserStore.getGlobalItem("current_user_id"); } - // this is a speical case to force fetch the - // current user if it's missing - // it's synchronous to block rendering - if (current_id == null && !skipFetch) { - var me = client.getMeSynchronous(); - if (me != null) { - this.setCurrentUser(me); - current_id = me.id; - } - } - return current_id; }, getCurrentUser: function(skipFetch) { |