From c4bba73833383c2317062fe0f9fd9ba6a4594f9b Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Tue, 18 Feb 2020 23:32:21 -0500 Subject: [PATCH] publish: invite-search shows valid ship in results --- .../publish/src/js/components/lib/invite-search.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/interface/publish/src/js/components/lib/invite-search.js b/pkg/interface/publish/src/js/components/lib/invite-search.js index f1408753e5..2678e04ed3 100644 --- a/pkg/interface/publish/src/js/components/lib/invite-search.js +++ b/pkg/interface/publish/src/js/components/lib/invite-search.js @@ -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 } + }) + } } }