mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-17 05:09:52 +03:00
reload values after write and update
This commit is contained in:
@@ -192,6 +192,7 @@ class EMSESPDataForm extends Component<
|
||||
this.props.enqueueSnackbar('Write command sent to device', {
|
||||
variant: 'success'
|
||||
});
|
||||
this.handleRowClick(selectedDevice);
|
||||
} else if (response.status === 204) {
|
||||
this.props.enqueueSnackbar('Write command failed', {
|
||||
variant: 'error'
|
||||
@@ -315,7 +316,7 @@ class EMSESPDataForm extends Component<
|
||||
<TableRow
|
||||
hover
|
||||
key={device.id}
|
||||
onClick={() => this.handleRowClick(device)}
|
||||
onClick={() => this.handleRowClick(device.id)}
|
||||
>
|
||||
<TableCell>
|
||||
<CustomTooltip
|
||||
@@ -522,10 +523,10 @@ class EMSESPDataForm extends Component<
|
||||
};
|
||||
|
||||
handleRowClick = (device: any) => {
|
||||
this.setState({ selectedDevice: device.id, deviceData: undefined });
|
||||
this.setState({ selectedDevice: device, deviceData: undefined });
|
||||
redirectingAuthorizedFetch(DEVICE_DATA_ENDPOINT, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ id: device.id }),
|
||||
body: JSON.stringify({ id: device }),
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user