summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-08-24 20:48:40 -0300
committerGitHub <noreply@github.com>2016-08-24 20:48:40 -0300
commit7bd26b19273e17ad0b6fb9e7fb89d04b9e171cfe (patch)
tree63179e631a38a1bc9b824ceb5c1cceafe42ef525 /webapp
parente6d15f77e8fa4ec27e104297667b28dc5f8517ca (diff)
downloadchat-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.jsx3
-rw-r--r--webapp/stores/user_store.jsx4
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;
}