summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-04-26 11:07:19 -0400
committerGitHub <noreply@github.com>2017-04-26 11:07:19 -0400
commit1fef5bf5fe37f161959fbef5d53deccf0168cced (patch)
tree30a9fe10147c48587600be8a5b88c5ae5ac5d558 /webapp
parent8e6141152bd0978bfeb24dbfff05972f4d17fd08 (diff)
downloadchat-1fef5bf5fe37f161959fbef5d53deccf0168cced.tar.gz
chat-1fef5bf5fe37f161959fbef5d53deccf0168cced.tar.bz2
chat-1fef5bf5fe37f161959fbef5d53deccf0168cced.zip
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
Diffstat (limited to 'webapp')
-rw-r--r--webapp/actions/user_actions.jsx2
-rw-r--r--webapp/components/team_sidebar/team_sidebar_controller.jsx3
-rw-r--r--webapp/stores/team_store.jsx6
3 files changed, 8 insertions, 3 deletions
diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx
index 8a794bb0a..d810b4c2e 100644
--- a/webapp/actions/user_actions.jsx
+++ b/webapp/actions/user_actions.jsx
@@ -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;
diff --git a/webapp/components/team_sidebar/team_sidebar_controller.jsx b/webapp/components/team_sidebar/team_sidebar_controller.jsx
index 2f41d485c..758b51426 100644
--- a/webapp/components/team_sidebar/team_sidebar_controller.jsx
+++ b/webapp/components/team_sidebar/team_sidebar_controller.jsx
@@ -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,
diff --git a/webapp/stores/team_store.jsx b/webapp/stores/team_store.jsx
index 1d3d5ff25..0317379fc 100644
--- a/webapp/stores/team_store.jsx
+++ b/webapp/stores/team_store.jsx
@@ -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
});
}