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