Browse Source

don't spam dashboard check

master
Gaëtan Renaudeau 7 years ago
parent
commit
85f84688f3
  1. 9
      src/components/Workflow/EnsureDashboard.js

9
src/components/Workflow/EnsureDashboard.js

@ -42,21 +42,20 @@ class EnsureDashboard extends PureComponent<Props, State> {
componentDidMount() {
this.checkForDashboard()
this._interval = setInterval(this.checkForDashboard, 1000)
}
componentDidUpdate() {
this.checkForDashboard()
componentDidUpdate({ device }: Props) {
if (this.props.device !== device && this.props.device) {
this.checkForDashboard()
}
}
componentWillUnmount() {
this._unmounting = true
clearInterval(this._interval)
}
_checking = false
_unmounting = false
_interval: *
checkForDashboard = async () => {
const { device } = this.props

Loading…
Cancel
Save