diff --git a/smart-hut/src/components/dashboard/DevicePanel.js b/smart-hut/src/components/dashboard/DevicePanel.js index 23db867..f55ee11 100644 --- a/smart-hut/src/components/dashboard/DevicePanel.js +++ b/smart-hut/src/components/dashboard/DevicePanel.js @@ -25,7 +25,7 @@ class DevicePanel extends Component { render() { return ( - {this.props.devices.length !== 0 ? ( + {this.props.numbeOfRooms > 0 ? ( {this.props.devices.map((e, i) => { return ; @@ -70,6 +70,9 @@ const mapStateToProps = (state, _) => ({ return state.active.activeRoom === -1; }, activeRoom: state.active.activeRoom, + get numbeOfRooms() { + return Object.keys(state.rooms).length; + }, }); const DevicePanelContainer = connect( mapStateToProps,