Show team in sidebar when joining through login (#6358)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
535eb14eeb
Коммит
6e642036f4
@@ -28,6 +28,9 @@ import {
|
|||||||
getTeamMembersForUser as getTeamMembersForUserRedux
|
getTeamMembersForUser as getTeamMembersForUserRedux
|
||||||
} from 'mattermost-redux/actions/teams';
|
} from 'mattermost-redux/actions/teams';
|
||||||
|
|
||||||
|
import {TeamTypes} from 'mattermost-redux/action_types';
|
||||||
|
import {batchActions} from 'redux-batched-actions';
|
||||||
|
|
||||||
export function checkIfTeamExists(teamName, onSuccess, onError) {
|
export function checkIfTeamExists(teamName, onSuccess, onError) {
|
||||||
checkIfTeamExistsRedux(teamName)(dispatch, getState).then(
|
checkIfTeamExistsRedux(teamName)(dispatch, getState).then(
|
||||||
(exists) => {
|
(exists) => {
|
||||||
@@ -104,6 +107,26 @@ export function addUserToTeamFromInvite(data, hash, inviteId, success, error) {
|
|||||||
hash,
|
hash,
|
||||||
inviteId,
|
inviteId,
|
||||||
(team) => {
|
(team) => {
|
||||||
|
const member = {
|
||||||
|
team_id: team.id,
|
||||||
|
user_id: getState().entities.users.currentUserId,
|
||||||
|
roles: 'team_user',
|
||||||
|
delete_at: 0,
|
||||||
|
msg_count: 0,
|
||||||
|
mention_count: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
dispatch(batchActions([
|
||||||
|
{
|
||||||
|
type: TeamTypes.RECEIVED_TEAMS_LIST,
|
||||||
|
data: [team]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: TeamTypes.RECEIVED_MY_TEAM_MEMBER,
|
||||||
|
data: member
|
||||||
|
}
|
||||||
|
]));
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
success(team);
|
success(team);
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user