mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-6253: Handle demote self from Team Admin. (#6056)
This commit is contained in:
@@ -953,3 +953,15 @@ export function getMissingProfiles(ids, success, error) {
|
||||
|
||||
AsyncClient.getProfilesByIds(missingIds, success, error);
|
||||
}
|
||||
|
||||
export function loadMyTeamMembers() {
|
||||
Client.getMyTeamMembers((data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_MY_TEAM_MEMBERS,
|
||||
team_members: data
|
||||
});
|
||||
AsyncClient.getMyTeamsUnread();
|
||||
}, (err) => {
|
||||
AsyncClient.dispatchError(err, 'getMyTeamMembers');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import UserStore from 'stores/user_store.jsx';
|
||||
import ChannelStore from 'stores/channel_store.jsx';
|
||||
|
||||
import {removeUserFromTeam, updateTeamMemberRoles} from 'actions/team_actions.jsx';
|
||||
import {updateActive} from 'actions/user_actions.jsx';
|
||||
import {loadMyTeamMembers, updateActive} from 'actions/user_actions.jsx';
|
||||
|
||||
import * as AsyncClient from 'utils/async_client.jsx';
|
||||
import * as Utils from 'utils/utils.jsx';
|
||||
@@ -49,6 +49,10 @@ export default class TeamMembersDropdown extends React.Component {
|
||||
'team_user',
|
||||
() => {
|
||||
AsyncClient.getUser(this.props.user.id);
|
||||
|
||||
if (this.props.user.id === me.id) {
|
||||
loadMyTeamMembers();
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
this.setState({serverError: err.message});
|
||||
|
||||
Reference in New Issue
Block a user