Skip to content

Commit

Permalink
[MM-23605] Reload team memberships when team scheme is updated (matte…
Browse files Browse the repository at this point in the history
…rmost#5344)

* MM-23605 Reload team memberships when team scheme is updated

* Update actions/websocket_actions.jsx

Co-authored-by: mattermod <[email protected]>
  • Loading branch information
fmunshi and mattermod committed Apr 27, 2020
1 parent b99ee55 commit c5d5049
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions actions/websocket_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ export function handleEvent(msg) {
handleUpdateTeamEvent(msg);
break;

case SocketEvents.UPDATE_TEAM_SCHEME:
handleUpdateTeamSchemeEvent(msg);
break;

case SocketEvents.DELETE_TEAM:
handleDeleteTeamEvent(msg);
break;
Expand Down Expand Up @@ -646,6 +650,10 @@ function handleUpdateTeamEvent(msg) {
dispatch({type: TeamTypes.UPDATED_TEAM, data: JSON.parse(msg.data.team)});
}

function handleUpdateTeamSchemeEvent() {
dispatch(TeamActions.getMyTeamMembers());
}

function handleDeleteTeamEvent(msg) {
const deletedTeam = JSON.parse(msg.data.team);
const state = store.getState();
Expand Down
1 change: 1 addition & 0 deletions utils/constants.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export const SocketEvents = {
LEAVE_TEAM: 'leave_team',
UPDATE_TEAM: 'update_team',
DELETE_TEAM: 'delete_team',
UPDATE_TEAM_SCHEME: 'update_team_scheme',
USER_ADDED: 'user_added',
USER_REMOVED: 'user_removed',
USER_UPDATED: 'user_updated',
Expand Down

0 comments on commit c5d5049

Please sign in to comment.