mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Redux bug fixes (#6243)
* Fix save teams dispatch * Fix login when MFA is enabled but not active * Fix JS error caused by using deleted team member
This commit is contained in:
@@ -631,7 +631,7 @@ export function checkMfa(loginId, success, error) {
|
||||
|
||||
checkMfaRedux(loginId)(dispatch, getState).then(
|
||||
(data) => {
|
||||
if (data && success) {
|
||||
if (data != null && success) {
|
||||
success(data);
|
||||
} else if (data == null && error) {
|
||||
const serverError = getState().requests.users.checkMfa.error;
|
||||
|
||||
@@ -102,6 +102,9 @@ export default class TeamSidebar extends React.Component {
|
||||
for (const index in this.state.teamMembers) {
|
||||
if (this.state.teamMembers.hasOwnProperty(index)) {
|
||||
const teamMember = this.state.teamMembers[index];
|
||||
if (teamMember.delete_at > 0) {
|
||||
continue;
|
||||
}
|
||||
const teamId = teamMember.team_id;
|
||||
myTeams.push(Object.assign({
|
||||
unread: teamMember.msg_count > 0,
|
||||
|
||||
@@ -185,12 +185,14 @@ class TeamStoreClass extends EventEmitter {
|
||||
}
|
||||
|
||||
saveTeam(team) {
|
||||
this.saveTeams([team]);
|
||||
const teams = {};
|
||||
teams[team.id] = team;
|
||||
this.saveTeams(teams);
|
||||
}
|
||||
|
||||
saveTeams(teams) {
|
||||
store.dispatch({
|
||||
type: TeamTypes.RECEIVED_TEAMS_LIST,
|
||||
type: TeamTypes.RECEIVED_TEAMS,
|
||||
data: teams
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user