diff options
author | enahum <nahumhbl@gmail.com> | 2016-08-24 20:48:40 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-24 20:48:40 -0300 |
commit | 7bd26b19273e17ad0b6fb9e7fb89d04b9e171cfe (patch) | |
tree | 63179e631a38a1bc9b824ceb5c1cceafe42ef525 /webapp | |
parent | e6d15f77e8fa4ec27e104297667b28dc5f8517ca (diff) | |
download | chat-7bd26b19273e17ad0b6fb9e7fb89d04b9e171cfe.tar.gz chat-7bd26b19273e17ad0b6fb9e7fb89d04b9e171cfe.tar.bz2 chat-7bd26b19273e17ad0b6fb9e7fb89d04b9e171cfe.zip |
Add missing directProfiles updates on real-time user updates (#3876)
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/actions/websocket_actions.jsx | 3 | ||||
-rw-r--r-- | webapp/stores/user_store.jsx | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/webapp/actions/websocket_actions.jsx b/webapp/actions/websocket_actions.jsx index 2abc6ebd4..1c4ef9c16 100644 --- a/webapp/actions/websocket_actions.jsx +++ b/webapp/actions/websocket_actions.jsx @@ -248,6 +248,9 @@ function handleUserRemovedEvent(msg) { function handleUserUpdatedEvent(msg) { if (UserStore.getCurrentId() !== msg.user_id) { UserStore.saveProfile(msg.data.user); + if (UserStore.hasDirectProfile(msg.user_id)) { + UserStore.saveDirectProfile(msg.data.user); + } UserStore.emitChange(msg.user_id); } } diff --git a/webapp/stores/user_store.jsx b/webapp/stores/user_store.jsx index ca4284d29..6a47d0f65 100644 --- a/webapp/stores/user_store.jsx +++ b/webapp/stores/user_store.jsx @@ -166,6 +166,10 @@ class UserStoreClass extends EventEmitter { return this.direct_profiles; } + saveDirectProfile(profile) { + this.direct_profiles[profile.id] = profile; + } + saveDirectProfiles(profiles) { this.direct_profiles = profiles; } |