mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 08:32:39 +03:00
Merge pull request #2310 from urbit/mp/os1/invite-search-ship
chat, publish: invite-search surfaces valid ship name as result
This commit is contained in:
commit
11d8953873
@ -68,6 +68,18 @@ export class InviteSearch extends Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
searchResults: { groups: groupMatches, ships: shipMatches }
|
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 }
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +69,18 @@ export class InviteSearch extends Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
searchResults: { groups: groupMatches, ships: shipMatches }
|
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 }
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user