Created
June 21, 2016 19:39
-
-
Save brunopedroso/40a8e1d2b8deb4a0183b0654b20ea6a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let profilesIntoConversation = this.get('currentProfile.conversations').reduce((profilesByConversation, currentConversation) => { | |
profilesByConversation.push({ | |
conversation: currentConversation, | |
profiles: currentConversation.get('participants').filter((participant) => { | |
return (this.removeAccents(participant.get('name').toLowerCase()).indexOf(filter) !== -1 | |
|| participant.get('phone').indexOf(filter) !== -1) | |
&& participant.get('remotoAddress') !== this.get('currentProfile.remotoAddress'); | |
}) | |
}); | |
return profilesByConversation; | |
}, []) | |
let profilesIntoConversation = this.get('currentProfile.conversations').map((currentConversation) => { | |
return { | |
conversation: currentConversation, | |
profiles: currentConversation.get('participants').filter((participant) => { | |
return (this.removeAccents(participant.get('name').toLowerCase()).indexOf(filter) !== -1 | |
|| participant.get('phone').indexOf(filter) !== -1) | |
&& participant.get('remotoAddress') !== this.get('currentProfile.remotoAddress'); | |
}) | |
}; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment