now passing the type to the remove function for scans
This commit is contained in:
parent
487c8617e4
commit
10308942ac
2 changed files with 6 additions and 6 deletions
|
|
@ -207,8 +207,8 @@ export default function DeviceScannedComponents(props: Props){
|
|||
setComponents(cloneList)
|
||||
}
|
||||
|
||||
const removeScan = (key: string) => {
|
||||
deviceAPI.removeFoundComponents(device.settings.deviceId, key)
|
||||
const removeScan = (key: string, type: pond.ObjectType) => {
|
||||
deviceAPI.removeFoundComponents(device.settings.deviceId, key, type)
|
||||
.then(resp => {
|
||||
console.log("Cleared this scan")
|
||||
}).catch(err => {
|
||||
|
|
@ -227,7 +227,7 @@ export default function DeviceScannedComponents(props: Props){
|
|||
<Typography sx={{fontWeight: 650}}>
|
||||
I2C Sensors
|
||||
</Typography>
|
||||
<Button variant="contained" color="primary" onClick={()=>{removeScan(scannedI2C.key)}}>Clear Scan</Button>
|
||||
<Button variant="contained" color="primary" onClick={()=>{removeScan(scannedI2C.key, pond.ObjectType.OBJECT_TYPE_DETECT_I2C)}}>Clear Scan</Button>
|
||||
</Box>
|
||||
{validI2CCompAddresses.length > 0 ? validI2CCompAddresses.map((addr, index) => {
|
||||
return (
|
||||
|
|
@ -269,7 +269,7 @@ export default function DeviceScannedComponents(props: Props){
|
|||
<Box display="flex" justifyContent="space-between" alignItems={"center"}>
|
||||
<Typography>Port: {portLabel}</Typography>
|
||||
<Button variant="contained" color="primary" onClick={()=>{
|
||||
removeScan(scan.key)
|
||||
removeScan(scan.key, pond.ObjectType.OBJECT_TYPE_DETECT_ONEWIRE)
|
||||
}}>Clear Port Scan</Button>
|
||||
</Box>
|
||||
<ScannedOneWirePort scan={scan} componentSelectionCallback={componentSelection}/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue