invite-search: always add search query if valid patp

This commit is contained in:
Liam Fitzgerald 2020-04-11 10:17:49 +10:00
parent e7887b34c3
commit e5634a913d
4 changed files with 8 additions and 8 deletions

View File

@ -127,8 +127,8 @@ export class InviteSearch extends Component {
isValid = false;
}
if (shipMatches.length === 0 && isValid) {
shipMatches.push(searchTerm);
if (isValid && shipMatches.findIndex(s => s === searchTerm) < 0) {
shipMatches.unshift(searchTerm);
}
}

View File

@ -128,8 +128,8 @@ export class InviteSearch extends Component {
isValid = false;
}
if (shipMatches.length === 0 && isValid) {
shipMatches.push(searchTerm);
if (isValid && shipMatches.findIndex(s => s === searchTerm) < 0) {
shipMatches.unshift(searchTerm);
}
}

View File

@ -128,8 +128,8 @@ export class InviteSearch extends Component {
isValid = false;
}
if (shipMatches.length === 0 && isValid) {
shipMatches.push(searchTerm);
if (isValid && shipMatches.findIndex(s => s === searchTerm) < 0) {
shipMatches.unshift(searchTerm);
}
}

View File

@ -128,8 +128,8 @@ export class InviteSearch extends Component {
isValid = false;
}
if (shipMatches.length === 0 && isValid) {
shipMatches.push(searchTerm);
if (isValid && shipMatches.findIndex(s => s === searchTerm) < 0) {
shipMatches.unshift(searchTerm);
}
}