Fixed issue with widgets not updating

Wouldn't refresh when successful->failed test or failed->successful
This commit is contained in:
Henry Whitaker
2020-08-08 23:33:23 +01:00
parent f0e2d28d8b
commit 2d805e3936

View File

@@ -18,14 +18,15 @@ export default class Widget extends Component {
}
componentDidUpdate = () => {
if(this.props.title != this.state.title || this.props.value != this.state.value || this.props.unit != this.state.unit || this.props.icon != this.state.icon || this.props.avg != this.state.avg || this.props.max != this.state.max) {
if(this.props.title != this.state.title || this.props.value != this.state.value || this.props.unit != this.state.unit || this.props.icon != this.state.icon || this.props.avg != this.state.avg || this.props.max != this.state.max || this.props.failed != this.state.failed) {
this.setState({
title: this.props.title,
value: this.props.value,
unit: this.props.unit,
icon: this.props.icon,
avg: this.props.avg,
max: this.props.max
max: this.props.max,
failed: this.props.failed,
});
}
}