Skip to content

Commit 9ea09f8

Browse files
Devices in room widget should correctly refresh list of device features (#1866)
1 parent ddaa068 commit 9ea09f8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

front/src/components/boxs/device-in-room/EditDeviceInRoom.jsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ class EditDeviceInRoom extends Component {
7474
}
7575

7676
componentDidUpdate(prevProps) {
77-
if (prevProps.box.room !== this.props.box.room && this.props.box.room) {
78-
this.getDeviceFeatures();
77+
if (prevProps.box && this.props.box && this.props.box.room) {
78+
const deviceFeaturesChanged = prevProps.box.device_features !== this.props.box.device_features;
79+
const roomChanged = prevProps.box.room !== this.props.box.room;
80+
if (deviceFeaturesChanged || roomChanged) {
81+
this.getDeviceFeatures();
82+
}
7983
}
8084
}
8185

0 commit comments

Comments
 (0)