Commit d1e3a0e4 by HaOuiha

fix bug

parent 54d429fa
...@@ -14,7 +14,7 @@ buildscript { ...@@ -14,7 +14,7 @@ buildscript {
maven { url "https://maven.google.com" } maven { url "https://maven.google.com" }
} }
dependencies { dependencies {
classpath("com.android.tools.build:gradle:3.4.1") classpath('com.android.tools.build:gradle:3.5.0')
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
......
...@@ -54,13 +54,13 @@ class SmartMeterDetailScreen extends Component { ...@@ -54,13 +54,13 @@ class SmartMeterDetailScreen extends Component {
_mcbLinksListMounted = false; _mcbLinksListMounted = false;
getDataInterval = null; getDataInterval = null;
deviceId = this.props.navigation.getParam('deviceId');
getData = async () => { getData = async () => {
const deviceId = this.props.navigation.getParam('deviceId'); await this.props.getCurrentSelectedData(this.deviceId, true);
await this.props.getCurrentSelectedData(deviceId, true);
await this.props.getTimers(); await this.props.getTimers();
this.getDataInterval = setInterval(() => this.props.getCurrentSelectedData(deviceId), 6000); this.getDataInterval = setInterval(() => this.props.getCurrentSelectedData(this.deviceId), 6000);
}; };
componentDidMount = async () => { componentDidMount = async () => {
...@@ -110,7 +110,7 @@ class SmartMeterDetailScreen extends Component { ...@@ -110,7 +110,7 @@ class SmartMeterDetailScreen extends Component {
this.setState({ isWaiting: true }); this.setState({ isWaiting: true });
await this.props.setMainStatus(value); await this.props.setMainStatus(value);
this.setState({ isWaiting: false }); this.setState({ isWaiting: false });
this.getDataInterval = setInterval(() => this.props.getCurrentSelectedData(deviceId), 6000); this.getDataInterval = setInterval(() => this.props.getCurrentSelectedData(this.deviceId), 6000);
}; };
componentWillUnmount = () => { componentWillUnmount = () => {
...@@ -253,7 +253,7 @@ class SmartMeterDetailScreen extends Component { ...@@ -253,7 +253,7 @@ class SmartMeterDetailScreen extends Component {
this.setState({ isWaiting: true }); this.setState({ isWaiting: true });
await this.props.setSubBreakerStatus(value, indexMcbLinks, indexSubBreakers); await this.props.setSubBreakerStatus(value, indexMcbLinks, indexSubBreakers);
this.setState({ isWaiting: false }); this.setState({ isWaiting: false });
this.getDataInterval = setInterval(() => this.props.getCurrentSelectedData(deviceId), 6000); this.getDataInterval = setInterval(() => this.props.getCurrentSelectedData(this.deviceId), 6000);
}; };
return ( return (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment