Fix duplicate entries in branch selector (#1794)

This commit is contained in:
Sebastian Sdorra
2021-09-02 15:09:45 +02:00
committed by GitHub
parent c408b38f10
commit 0ba8300051
2 changed files with 6 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ const InnerSelect: FC<FieldProps<BaseProps, HTMLSelectElement, string>> = ({
const field = useInnerRef(props.innerRef);
let opts = options;
if (value && addValueToOptions && options.some((o) => o.value === value)) {
if (value && addValueToOptions && !options.some((o) => o.value === value)) {
opts = [{ label: value, value }, ...options];
}