re-fix navbar and device panel

This commit is contained in:
britea 2020-03-18 13:20:01 +01:00
parent 50bc259990
commit 07edc884b9
2 changed files with 4 additions and 10 deletions

View File

@ -41,7 +41,7 @@ export default class DevicePanel extends Component {
} }
} }
return null; return null;
}); });
this.forceUpdate(); this.forceUpdate();
}; };

View File

@ -31,21 +31,17 @@ export default class Dashboard extends Component{
componentDidMount() { componentDidMount() {
call.getAllRooms(this.props.tkn) call.getAllRooms(this.props.tkn)
.then(res => { .then(res => {
console.log(res.data.length);
res.data.forEach((e) => {
this.setState({ this.setState({
rooms: res.data rooms: res.data
}); });
});
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });
call.getAllDevices(this.props.tkn) call.getAllDevices(this.props.tkn)
.then(res => { .then(res => {
console.log(res); this.setState({
this.setState({ devices: res.data
devices : res.data });
});
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });
@ -79,11 +75,9 @@ export default class Dashboard extends Component{
//da fare richiesta get della room e settare activeItem //da fare richiesta get della room e settare activeItem
call.getAllDevicesByRoom(id, this.props.tkn) call.getAllDevicesByRoom(id, this.props.tkn)
.then(res => { .then(res => {
res.data.forEach((e) => {
this.setState({ this.setState({
devices: res.data devices: res.data
}); });
});
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });