fix problems with rendering data

This commit is contained in:
Eric Hulburd
2016-02-21 18:40:55 -06:00
parent a84df34b55
commit c1fddd944e
28 changed files with 456 additions and 158 deletions

View File

@@ -22,7 +22,7 @@ var Energy = React.createClass({
var energy = this,
house = energy.props.house;
energy.graph_title = 'Daily Consumption';
house.ensureEnergyData().then(()=>{
house.setEnergyData().then(()=>{
energy.setState({loading_data: false});
if (energy.props.view === 'graph') energy.initGraph();
});
@@ -32,7 +32,7 @@ var Energy = React.createClass({
var energy = this;
if (new_props.house !== energy.state.house){
energy.setState({loading_data: true});
new_props.house.ensureEnergyData().then(()=>{
new_props.house.setEnergyData().then(()=>{
energy.setState({loading_data: false});
if (energy.props.view === 'graph') energy.initGraph();
});