chat: invite-search shows valid ship in results

This commit is contained in:
Matilde Park 2020-02-18 23:32:11 -05:00
parent 5b1c3f3cca
commit 7aeb593fb4

View File

@ -68,6 +68,18 @@ export class InviteSearch extends Component {
this.setState({
searchResults: { groups: groupMatches, ships: shipMatches }
});
let isValid = true;
if (!urbitOb.isValidPatp("~" + searchTerm)) {
isValid = false;
}
if ((shipMatches.length === 0) && (isValid)) {
shipMatches.push(searchTerm);
this.setState({
searchResults: { groups: groupMatches, ships: shipMatches }
})
}
}
}