PLT-6253: Handle demote self from Team Admin. (#6056)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9fa4712dd7
Коммит
9c3b96661b
@@ -953,3 +953,15 @@ export function getMissingProfiles(ids, success, error) {
|
|||||||
|
|
||||||
AsyncClient.getProfilesByIds(missingIds, 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 ChannelStore from 'stores/channel_store.jsx';
|
||||||
|
|
||||||
import {removeUserFromTeam, updateTeamMemberRoles} from 'actions/team_actions.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 AsyncClient from 'utils/async_client.jsx';
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
@@ -49,6 +49,10 @@ export default class TeamMembersDropdown extends React.Component {
|
|||||||
'team_user',
|
'team_user',
|
||||||
() => {
|
() => {
|
||||||
AsyncClient.getUser(this.props.user.id);
|
AsyncClient.getUser(this.props.user.id);
|
||||||
|
|
||||||
|
if (this.props.user.id === me.id) {
|
||||||
|
loadMyTeamMembers();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
this.setState({serverError: err.message});
|
this.setState({serverError: err.message});
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user