diff --git a/src/device/autoDetect/ScannedI2C.tsx b/src/device/autoDetect/ScannedI2C.tsx index d937c7d..915a29b 100644 --- a/src/device/autoDetect/ScannedI2C.tsx +++ b/src/device/autoDetect/ScannedI2C.tsx @@ -21,7 +21,7 @@ export default function ScannedI2C(props: Props){ const [subtypeOptions, setSubtypeOptions] = useState>([]) const [selectedPrimaryType, setSelectedPrimaryType] = useState(quack.ComponentType.COMPONENT_TYPE_INVALID) const [selectedPrimarySubtype, setSelectedPrimarySubtype] = useState(0) - const [added,setAdded] = useState(false) + const [added, setAdded] = useState(false) const [addressInUse, setAddressInUse] = useState(false) useEffect(()=>{ @@ -80,7 +80,7 @@ export default function ScannedI2C(props: Props){ const componentSelected = (event: React.ChangeEvent, checked: boolean) => { let toAdd: Component[] = [] - setAdded(true) + setAdded(checked) //build a component with given information and defaults for the rest let primaryComponent = Component.create() primaryComponent.settings.type = selectedPrimaryType @@ -120,6 +120,7 @@ export default function ScannedI2C(props: Props){ {types.map((type, i) => { return ( } @@ -132,6 +133,7 @@ export default function ScannedI2C(props: Props){ {subtypeOptions.length > 0 && { @@ -152,7 +154,7 @@ export default function ScannedI2C(props: Props){ } />