Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brunopedroso/40a8e1d2b8deb4a0183b0654b20ea6a4 to your computer and use it in GitHub Desktop.
Save brunopedroso/40a8e1d2b8deb4a0183b0654b20ea6a4 to your computer and use it in GitHub Desktop.
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