Fix many eslint warnings

This commit is contained in:
uwap 2018-07-10 18:08:13 +02:00
parent f7972afcd4
commit b1bf5efd11
7 changed files with 46 additions and 39 deletions

View file

@ -57,7 +57,7 @@ class App extends React.PureComponent<AppProps & Classes, AppState> {
Object.assign({}, ...this.props.config.topics) : this.props.config.topics;
}
static styles(_theme: Object) {
static styles() {
return {
drawerPaper: {
width: 320
@ -83,10 +83,9 @@ class App extends React.PureComponent<AppProps & Classes, AppState> {
return;
}
for (let i in topics) {
// TODO: Remove FlowFixMe
const topic = topics[i];
// $FlowFixMe
const parseValue = this.topics[topic].state.type;
const stateTopic = this.topics[topic].state;
const parseValue = stateTopic ? stateTopic.type : null;
const val = parseValue == null ? message.toString() : parseValue(message);
this.setState({mqttState: Object.assign({}, merge(this.state.mqttState,
{ [topic]: val}))});