Merge branch '40-re-fix-navbar-and-devicepanel' into 'dev'

re-fix navbar and device panel

Closes #40

See merge request sa4-2020/the-sanmarinoes/frontend!37
This commit is contained in:
Claudio Maggioni 2020-03-18 13:35:05 +01:00
commit 7faa63e484
2 changed files with 4 additions and 10 deletions

View file

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

View file

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