PLT-3942 Add real-time updates for center channel profile picture popover (#3871)
* PLT-3942 Add real-time updates for center channel profile picture pop-over * Send user data with the websocket event to prevent further requests * Add helper for profile sanitation
Этот коммит содержится в:
@@ -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 &&
|
||||
|
||||
@@ -194,6 +194,7 @@ export const Constants = {
|
||||
LEAVE_TEAM: 'leave_team',
|
||||
USER_ADDED: 'user_added',
|
||||
USER_REMOVED: 'user_removed',
|
||||
USER_UPDATED: 'user_updated',
|
||||
TYPING: 'typing',
|
||||
PREFERENCE_CHANGED: 'preference_changed',
|
||||
EPHEMERAL_MESSAGE: 'ephemeral_message',
|
||||
|
||||
Ссылка в новой задаче
Block a user