fixed warning message in device panel thanks to andrea
This commit is contained in:
parent
b61148b24a
commit
bb91bb1ee2
1 changed files with 4 additions and 1 deletions
|
@ -25,7 +25,7 @@ class DevicePanel extends Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Card.Group centered style={{ paddingTop: "3rem" }}>
|
<Card.Group centered style={{ paddingTop: "3rem" }}>
|
||||||
{this.props.devices.length !== 0 ? (
|
{this.props.numbeOfRooms > 0 ? (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{this.props.devices.map((e, i) => {
|
{this.props.devices.map((e, i) => {
|
||||||
return <Device key={i} tab={this.props.tab} id={e.id} />;
|
return <Device key={i} tab={this.props.tab} id={e.id} />;
|
||||||
|
@ -70,6 +70,9 @@ const mapStateToProps = (state, _) => ({
|
||||||
return state.active.activeRoom === -1;
|
return state.active.activeRoom === -1;
|
||||||
},
|
},
|
||||||
activeRoom: state.active.activeRoom,
|
activeRoom: state.active.activeRoom,
|
||||||
|
get numbeOfRooms() {
|
||||||
|
return Object.keys(state.rooms).length;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const DevicePanelContainer = connect(
|
const DevicePanelContainer = connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
|
|
Loading…
Reference in a new issue