mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
all: exclude ships from invite search when shipResults is false
fixes #3508
This commit is contained in:
parent
91ddc70c60
commit
37e858004c
@ -151,26 +151,26 @@ export class InviteSearch extends Component<
|
||||
);
|
||||
});
|
||||
|
||||
for (const contact of state.contacts.keys()) {
|
||||
const thisContact = state.contacts.get(contact) || [];
|
||||
const match = thisContact.filter((e) => {
|
||||
return e.toLowerCase().includes(searchTerm);
|
||||
});
|
||||
if (match.length > 0) {
|
||||
if (!(contact in shipMatches)) {
|
||||
shipMatches.push(contact);
|
||||
}
|
||||
for (const contact of state.contacts.keys()) {
|
||||
const thisContact = state.contacts.get(contact) || [];
|
||||
const match = thisContact.filter((e) => {
|
||||
return e.toLowerCase().includes(searchTerm);
|
||||
});
|
||||
if (match.length > 0) {
|
||||
if (!(contact in shipMatches) && props.shipResults) {
|
||||
shipMatches.push(contact);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let isValid = true;
|
||||
if (!urbitOb.isValidPatp('~' + searchTerm)) {
|
||||
isValid = false;
|
||||
}
|
||||
let isValid = true;
|
||||
if (!urbitOb.isValidPatp('~' + searchTerm)) {
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (props.shipResults && isValid && shipMatches.findIndex((s) => s === searchTerm) < 0) {
|
||||
shipMatches.unshift(searchTerm);
|
||||
}
|
||||
if (props.shipResults && isValid && shipMatches.findIndex((s) => s === searchTerm) < 0) {
|
||||
shipMatches.unshift(searchTerm);
|
||||
}
|
||||
|
||||
const { selected } = state;
|
||||
const groupIdx = groupMatches.findIndex(([path]) => path === selected);
|
||||
|
Loading…
Reference in New Issue
Block a user