diff --git a/src/components/views/dialogs/DMInviteDialog.js b/src/components/views/dialogs/DMInviteDialog.js index aadb07edea..2a4640205d 100644 --- a/src/components/views/dialogs/DMInviteDialog.js +++ b/src/components/views/dialogs/DMInviteDialog.js @@ -541,10 +541,10 @@ export default class DMInviteDialog extends React.PureComponent { const hasMixins = this.state.serverResultsMixin || this.state.threepidResultsMixin; if (this.state.filterText && hasMixins && kind === 'suggestions') { // We don't want to duplicate members though, so just exclude anyone we've already seen. - function notAlreadyExists(u: Member): boolean { + const notAlreadyExists = (u: Member): boolean => { return !sourceMembers.some(m => m.userId === u.userId) && !additionalMembers.some(m => m.userId === u.userId); - } + }; const uniqueServerResults = this.state.serverResultsMixin.filter(notAlreadyExists); additionalMembers = additionalMembers.concat(...uniqueServerResults);