Skip to content

Commit

Permalink
Fix filter groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaisa Korpela committed Oct 13, 2020
1 parent 26b1ec5 commit bbafbda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ async function getMemberData(groupMembers) {

function filterGroups(userNumber, groupsData) {
return groupsData.filter(groupData => {
const groupMember = groupData.members.filter(member => {
const groupMember = groupData.members.find(member => {
return member.memberId == userNumber
})
return groupMember[0].isGroupLeader === true
return groupMember ? groupMember.isGroupLeader : false
})
}

Expand Down

0 comments on commit bbafbda

Please sign in to comment.