publish: invite-search shows valid ship in results

This commit is contained in:
Matilde Park 2020-02-18 23:32:21 -05:00
parent 7aeb593fb4
commit c4bba73833

View File

@ -69,6 +69,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 }
})
}
}
}