diff options
author | Corey Hulen <corey@hulen.com> | 2015-10-23 14:59:25 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-10-23 14:59:25 -0700 |
commit | 03140752e60addd13e162036fe6605629b5591c6 (patch) | |
tree | 3e83b7dd2ca733a7dd3abba398fc2f2f06b453d7 /web/react/stores/user_store.jsx | |
parent | 17731698495e917cc3d64dc01d158a7c15912bd6 (diff) | |
parent | a5a2826700b1fc6b19ba38698cfa703f58476bc6 (diff) | |
download | chat-03140752e60addd13e162036fe6605629b5591c6.tar.gz chat-03140752e60addd13e162036fe6605629b5591c6.tar.bz2 chat-03140752e60addd13e162036fe6605629b5591c6.zip |
Merge pull request #1133 from hmhealey/plt718
PLT-718 Add an autocomplete when searching with in:, channel:, or from:
Diffstat (limited to 'web/react/stores/user_store.jsx')
-rw-r--r-- | web/react/stores/user_store.jsx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/web/react/stores/user_store.jsx b/web/react/stores/user_store.jsx index 575e6d51e..ce80c5ec9 100644 --- a/web/react/stores/user_store.jsx +++ b/web/react/stores/user_store.jsx @@ -48,6 +48,7 @@ class UserStoreClass extends EventEmitter { this.getProfilesUsernameMap = this.getProfilesUsernameMap.bind(this); this.getProfiles = this.getProfiles.bind(this); this.getActiveOnlyProfiles = this.getActiveOnlyProfiles.bind(this); + this.getActiveOnlyProfileList = this.getActiveOnlyProfileList.bind(this); this.saveProfile = this.saveProfile.bind(this); this.setSessions = this.setSessions.bind(this); this.getSessions = this.getSessions.bind(this); @@ -215,6 +216,19 @@ class UserStoreClass extends EventEmitter { return active; } + getActiveOnlyProfileList() { + const profileMap = this.getActiveOnlyProfiles(); + const profiles = []; + + for (const id in profileMap) { + if (profileMap.hasOwnProperty(id)) { + profiles.push(profileMap[id]); + } + } + + return profiles; + } + saveProfile(profile) { var ps = this.getProfiles(); ps[profile.id] = profile; |