From 07edc884b93001a3387a295bd561b505f8fd67ac Mon Sep 17 00:00:00 2001 From: britea Date: Wed, 18 Mar 2020 13:20:01 +0100 Subject: [PATCH] re-fix navbar and device panel --- smart-hut/src/components/dashboard/DevicePanel.js | 2 +- smart-hut/src/views/Dashboard.js | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/smart-hut/src/components/dashboard/DevicePanel.js b/smart-hut/src/components/dashboard/DevicePanel.js index 87c323f..c7d71d9 100644 --- a/smart-hut/src/components/dashboard/DevicePanel.js +++ b/smart-hut/src/components/dashboard/DevicePanel.js @@ -41,7 +41,7 @@ export default class DevicePanel extends Component { } } return null; - }); + }); this.forceUpdate(); }; diff --git a/smart-hut/src/views/Dashboard.js b/smart-hut/src/views/Dashboard.js index 0913c7b..7134ac2 100644 --- a/smart-hut/src/views/Dashboard.js +++ b/smart-hut/src/views/Dashboard.js @@ -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); });