Skip to content

Commit

Permalink
[MM-10455] Include "id" to data for UserTypes actions - RECEIVED_PROF…
Browse files Browse the repository at this point in the history
…ILE_(NOT)_IN_TEAM / RECEIVED_PROFILE_(NOT)_IN_CHANNEL (mattermost#1214)

* include "id" to data for UserTypes actions - RECEIVED_PROFILE_(NOT)_IN_TEAM / RECEIVED_PROFILE_(NOT)_IN_CHANNEL

* update commit of mattermost-redux
  • Loading branch information
saturninoabril committed May 15, 2018
1 parent 33979b9 commit feadd71
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 24 deletions.
9 changes: 3 additions & 6 deletions actions/websocket_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ function handleLeaveTeamEvent(msg) {
dispatch(batchActions([
{
type: UserTypes.RECEIVED_PROFILE_NOT_IN_TEAM,
data: {user_id: msg.data.user_id},
id: msg.data.team_id,
data: {id: msg.data.team_id, user_id: msg.data.user_id},
},
{
type: TeamTypes.REMOVE_MEMBER_FROM_TEAM,
Expand Down Expand Up @@ -464,8 +463,7 @@ function handleUserAddedEvent(msg) {
getChannelStats(ChannelStore.getCurrentId())(dispatch, getState);
dispatch({
type: UserTypes.RECEIVED_PROFILE_IN_CHANNEL,
data: {user_id: msg.data.user_id},
id: msg.broadcast.channel_id,
data: {id: msg.broadcast.channel_id, user_id: msg.data.user_id},
});
}

Expand Down Expand Up @@ -503,8 +501,7 @@ function handleUserRemovedEvent(msg) {
getChannelStats(ChannelStore.getCurrentId())(dispatch, getState);
dispatch({
type: UserTypes.RECEIVED_PROFILE_NOT_IN_CHANNEL,
data: {user_id: msg.data.user_id},
id: msg.broadcast.channel_id,
data: {id: msg.broadcast.channel_id, user_id: msg.data.user_id},
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"localforage": "1.5.6",
"localforage-observable": "1.4.0",
"marked": "mattermost/marked#4bc7e5f00c324d2eadec6b932224871497af6f7c",
"mattermost-redux": "github:mattermost/mattermost-redux#b1bb31daf58d5ec88f4f14627d6fe655d1570c03",
"mattermost-redux": "github:mattermost/mattermost-redux#50222617bbbe6381b4777c091720c6f6d833adbe",
"moment-timezone": "0.5.14",
"pdfjs-dist": "2.0.290",
"perfect-scrollbar": "0.8.1",
Expand Down
21 changes: 7 additions & 14 deletions stores/user_store.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,7 @@ class UserStoreClass extends EventEmitter {
removeProfileFromTeam(teamId, userId) {
store.dispatch({
type: UserTypes.RECEIVED_PROFILE_NOT_IN_TEAM,
data: {user_id: userId},
id: teamId,
data: {id: teamId, user_id: userId},
});
}

Expand Down Expand Up @@ -364,8 +363,7 @@ class UserStoreClass extends EventEmitter {
removeProfileNotInTeam(teamId, userId) {
store.dispatch({
type: UserTypes.RECEIVED_PROFILE_IN_TEAM,
data: {user_id: userId},
id: teamId,
data: {id: teamId, user_id: userId},
});
}

Expand All @@ -374,24 +372,21 @@ class UserStoreClass extends EventEmitter {
saveProfileInChannel(channelId = ChannelStore.getCurrentId(), profile) {
store.dispatch({
type: UserTypes.RECEIVED_PROFILE_IN_CHANNEL,
data: {user_id: profile.id},
id: channelId,
data: {id: channelId, user_id: profile.id},
});
}

saveUserIdInChannel(channelId = ChannelStore.getCurrentId(), userId) {
store.dispatch({
type: UserTypes.RECEIVED_PROFILE_IN_CHANNEL,
data: {user_id: userId},
id: channelId,
data: {id: channelId, user_id: userId},
});
}

removeProfileInChannel(channelId, userId) {
store.dispatch({
type: UserTypes.RECEIVED_PROFILE_NOT_IN_CHANNEL,
data: {user_id: userId},
id: channelId,
data: {id: channelId, user_id: userId},
});
}

Expand All @@ -404,16 +399,14 @@ class UserStoreClass extends EventEmitter {
saveProfileNotInChannel(channelId = ChannelStore.getCurrentId(), profile) {
store.dispatch({
type: UserTypes.RECEIVED_PROFILE_NOT_IN_CHANNEL,
data: {user_id: profile.id},
id: channelId,
data: {id: channelId, user_id: profile.id},
});
}

removeProfileNotInChannel(channelId, userId) {
store.dispatch({
type: UserTypes.RECEIVED_PROFILE_IN_CHANNEL,
data: {user_id: userId},
id: channelId,
data: {id: channelId, user_id: userId},
});
}

Expand Down

0 comments on commit feadd71

Please sign in to comment.