mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 20:47:27 +03:00
parent
f20da46745
commit
d21c929518
@ -159,6 +159,14 @@ export function ShipSearch<I extends string, V extends Value<I>>(
|
||||
|
||||
const error = _.compact(errors[id] as string[]);
|
||||
|
||||
const isExact = useCallback((s: string) => {
|
||||
const ship = `~${deSig(s)}`;
|
||||
const result = ob.isValidPatp(ship);
|
||||
return (result && !selected.includes(deSig(s)))
|
||||
? deSig(s) ?? undefined
|
||||
: undefined;
|
||||
}, [selected]);
|
||||
|
||||
return (
|
||||
<FieldArray
|
||||
name={id}
|
||||
@ -185,11 +193,7 @@ export function ShipSearch<I extends string, V extends Value<I>>(
|
||||
|
||||
<DropdownSearch<string>
|
||||
mt="2"
|
||||
isExact={(s) => {
|
||||
const ship = `~${deSig(s)}`;
|
||||
const result = ob.isValidPatp(ship);
|
||||
return result ? deSig(s) ?? undefined : undefined;
|
||||
}}
|
||||
isExact={isExact}
|
||||
placeholder="Search for ships"
|
||||
candidates={peers}
|
||||
renderCandidate={renderCandidate}
|
||||
|
Loading…
Reference in New Issue
Block a user