ShipSearch: fix error reporting

Fixes urbit/landscape#753
This commit is contained in:
Liam Fitzgerald 2021-04-09 12:04:55 +10:00
parent 3903ff8ad3
commit 7bbef74ffe
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -157,7 +157,7 @@ export function ShipSearch<I extends string, V extends Value<I>>(
setFieldValue(name(), newValue);
};
const error = _.compact(errors[id] as string[]);
const error = _.compact((_.isString(errors[id]) ? [errors[id]] : errors[id] as string[]) as any);
const isExact = useCallback((s: string) => {
const ship = `~${deSig(s)}`;