diff options
Diffstat (limited to 'webapp/actions')
-rw-r--r-- | webapp/actions/websocket_actions.jsx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/webapp/actions/websocket_actions.jsx b/webapp/actions/websocket_actions.jsx index fb0fbf513..2abc6ebd4 100644 --- a/webapp/actions/websocket_actions.jsx +++ b/webapp/actions/websocket_actions.jsx @@ -128,6 +128,10 @@ function handleEvent(msg) { handleUserRemovedEvent(msg); break; + case SocketEvents.USER_UPDATED: + handleUserUpdatedEvent(msg); + break; + case SocketEvents.CHANNEL_VIEWED: handleChannelViewedEvent(msg); break; @@ -241,6 +245,13 @@ function handleUserRemovedEvent(msg) { } } +function handleUserUpdatedEvent(msg) { + if (UserStore.getCurrentId() !== msg.user_id) { + UserStore.saveProfile(msg.data.user); + UserStore.emitChange(msg.user_id); + } +} + function handleChannelViewedEvent(msg) { // Useful for when multiple devices have the app open to different channels if (TeamStore.getCurrentId() === msg.team_id && |