Skip to content

Commit

Permalink
Fixing redirection on leave channel (mattermost#4234)
Browse files Browse the repository at this point in the history
* Fixing redirection on leave channel

* fixing tests
  • Loading branch information
jespino committed Nov 15, 2019
1 parent 77948dd commit 8fbe8d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion actions/global_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ async function getTeamRedirectChannelIfIsAccesible(user, team) {
let channel = null;

const myMember = getMyTeamMember(state, team.id);
if (!myMember) {
if (!myMember || Object.keys(myMember).length === 0) {
return null;
}

Expand Down
20 changes: 10 additions & 10 deletions actions/global_actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ describe('actions/global_actions', () => {
team2: {id: 'team2', display_name: 'Team 2', name: 'team2', delete_at: 0},
},
myMembers: {
team1: {},
team2: {},
team1: {id: 'team1'},
team2: {id: 'team2'},
},
},
channels: {
Expand Down Expand Up @@ -164,8 +164,8 @@ describe('actions/global_actions', () => {
team2: {id: 'team2', display_name: 'Team 2', name: 'team2', delete_at: 0},
},
myMembers: {
team1: {},
team2: {},
team1: {id: 'team1'},
team2: {id: 'team2'},
},
},
channels: {
Expand Down Expand Up @@ -239,8 +239,8 @@ describe('actions/global_actions', () => {
team2: {id: 'team2', display_name: 'Team 2', name: 'team2', delete_at: 0},
},
myMembers: {
team1: {},
team2: {},
team1: {id: 'team1'},
team2: {id: 'team2'},
},
},
channels: {
Expand Down Expand Up @@ -307,8 +307,8 @@ describe('actions/global_actions', () => {
team2: {id: 'team2', display_name: 'Team 2', name: 'team2', delete_at: 0},
},
myMembers: {
team1: {},
team2: {},
team1: {id: 'team1'},
team2: {id: 'team2'},
},
},
users: {
Expand Down Expand Up @@ -346,8 +346,8 @@ describe('actions/global_actions', () => {
team2: {id: 'team2', display_name: 'Team 2', name: 'team2', delete_at: 0},
},
myMembers: {
team1: {},
team2: {},
team1: {id: 'team1'},
team2: {id: 'team2'},
},
},
channels: {
Expand Down

0 comments on commit 8fbe8d2

Please sign in to comment.