Skip to content

Commit

Permalink
Fixes fossasia#1270: Remove console error due to Devices section (fos…
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatnitd authored and mariobehling committed May 29, 2018
1 parent 59be98f commit 88d80ac
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/components/ChatApp/Settings/Settings.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,24 @@ class Settings extends Component {
async: false,
success: function (response) {
obj=[];
let keys = Object.keys(response.devices);
keys.forEach((i) => {
let myObj = {
'macid' : i,
'devicename' : Object.keys(response.devices[i])[0]
};
obj.push( myObj );
this.setState({
dataFetched: true,
});
});
if(obj.length){
this.setState({
deviceData: true,
if(response.devices)
{
let keys = Object.keys(response.devices);
keys.forEach((i) => {
let myObj = {
'macid' : i,
'devicename' : Object.keys(response.devices[i])[0]
};
obj.push( myObj );
this.setState({
dataFetched: true,
});
});
if(obj.length){
this.setState({
deviceData: true,
});
}
}
}.bind(this),
error: function(errorThrown){
Expand Down

0 comments on commit 88d80ac

Please sign in to comment.