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 df5007d2c4..d3aac8ee1b 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 } + }) + } } } 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 } + }) + } } }