Merge pull request #5619 from urbit/po/invite-to-group-issue

groups: fix issue with adding duplicate ships to shipsearch pills
This commit is contained in:
Patrick O'Sullivan 2022-03-03 08:37:09 -06:00 committed by GitHub
commit a62ddac47a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,9 +167,11 @@ export function ShipSearch<I extends string, V extends Value<I>>(
name={id} name={id}
render={(arrayHelpers) => { render={(arrayHelpers) => {
const onAdd = (ship: string) => { const onAdd = (ship: string) => {
if (!pills.includes(ship)) {
setFieldValue(name(), ship); setFieldValue(name(), ship);
inputIdx.current += 1; inputIdx.current += 1;
arrayHelpers.push(''); arrayHelpers.push('');
}
}; };
const onRemove = (idx: number) => { const onRemove = (idx: number) => {