Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/pages/NewChatPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class NewChatPage extends Component {
const filterText = _.reduce(this.state.selectedOptions, (str, {login}) => `${str} ${login}`, '');
const recentReportsWithoutSelected = _.filter(this.state.recentReports, ({login}) => !filterText.includes(login));
const personalDetailsWithoutSelected = _.filter(this.state.personalDetails, ({login}) => !filterText.includes(login));
const hasUnselectedUserToInvite = this.state.userToInvite && !filterText.includes(this.state.userToInvite.login);

sections.push({
title: this.props.translate('common.recents'),
Expand All @@ -127,7 +128,7 @@ class NewChatPage extends Component {
indexOffset: _.reduce(sections, (prev, {data}) => prev + data.length, 0),
});

if (this.state.userToInvite) {
if (hasUnselectedUserToInvite) {
sections.push(({
title: undefined,
data: [this.state.userToInvite],
Expand Down
3 changes: 2 additions & 1 deletion src/pages/workspace/WorkspaceInvitePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class WorkspaceInvitePage extends React.Component {
// Filtering out selected users from the search results
const filterText = _.reduce(this.state.selectedOptions, (str, {login}) => `${str} ${login}`, '');
const personalDetailsWithoutSelected = _.filter(this.state.personalDetails, ({login}) => !filterText.includes(login));
const hasUnselectedUserToInvite = this.state.userToInvite && !filterText.includes(this.state.userToInvite.login);

sections.push({
title: this.props.translate('common.contacts'),
Expand All @@ -149,7 +150,7 @@ class WorkspaceInvitePage extends React.Component {
indexOffset: _.reduce(sections, (prev, {data}) => prev + data.length, 0),
});

if (this.state.userToInvite) {
if (hasUnselectedUserToInvite) {
sections.push(({
title: undefined,
data: [this.state.userToInvite],
Expand Down