diff options
author | =Corey Hulen <corey@hulen.com> | 2015-10-25 22:42:38 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-10-25 22:42:38 -0700 |
commit | 70b5918734d996a2b5b3710c2ed519f77f4764d4 (patch) | |
tree | 12aac9f88de68cb79404a3985e6bfe774ad8f066 /web/react/stores | |
parent | 473221dbada7ad7739d6a969d9d3d5c9c276941b (diff) | |
parent | ae2898107d275176126ab07ca1886fd7fd7ddad4 (diff) | |
download | chat-70b5918734d996a2b5b3710c2ed519f77f4764d4.tar.gz chat-70b5918734d996a2b5b3710c2ed519f77f4764d4.tar.bz2 chat-70b5918734d996a2b5b3710c2ed519f77f4764d4.zip |
Merge branch 'master' into PLT-25
Diffstat (limited to 'web/react/stores')
-rw-r--r-- | web/react/stores/browser_store.jsx | 4 | ||||
-rw-r--r-- | web/react/stores/socket_store.jsx | 2 | ||||
-rw-r--r-- | web/react/stores/user_store.jsx | 14 |
3 files changed, 17 insertions, 3 deletions
diff --git a/web/react/stores/browser_store.jsx b/web/react/stores/browser_store.jsx index adaca44ee..75fb8aa3c 100644 --- a/web/react/stores/browser_store.jsx +++ b/web/react/stores/browser_store.jsx @@ -74,9 +74,9 @@ class BrowserStoreClass { var result = null; try { if (this.isLocalStorageSupported()) { - result = JSON.parse(getPrefix() + localStorage.getItem(name)); + result = JSON.parse(localStorage.getItem(getPrefix() + name)); } else { - result = JSON.parse(getPrefix() + sessionStorage.getItem(name)); + result = JSON.parse(sessionStorage.getItem(getPrefix() + name)); } } catch (err) { result = null; diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx index 8c3489001..9410c1e9c 100644 --- a/web/react/stores/socket_store.jsx +++ b/web/react/stores/socket_store.jsx @@ -158,7 +158,7 @@ function handleNewPostEvent(msg) { // Update channel state if (ChannelStore.getCurrentId() === msg.channel_id) { if (window.isActive) { - AsyncClient.updateLastViewedAt(); + AsyncClient.updateLastViewedAt(true); } } else { AsyncClient.getChannel(msg.channel_id); 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; |