Browse Source

Fix infinite `getAddress`

master
meriadec 7 years ago
parent
commit
1d0339205d
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 5
      src/components/EnsureDeviceApp/index.js

5
src/components/EnsureDeviceApp/index.js

@ -89,6 +89,8 @@ class EnsureDeviceApp extends PureComponent<Props, State> {
if (prevDeviceSelected !== deviceSelected) { if (prevDeviceSelected !== deviceSelected) {
this.handleStatusChange('connected', 'progress') this.handleStatusChange('connected', 'progress')
// TODO: refacto to more generic/global way
clearTimeout(this._timeout)
this._timeout = setTimeout(this.checkAppOpened, 250) this._timeout = setTimeout(this.checkAppOpened, 250)
} }
} }
@ -148,8 +150,11 @@ class EnsureDeviceApp extends PureComponent<Props, State> {
this.handleStatusChange(this.state.deviceStatus, 'fail', e.message) this.handleStatusChange(this.state.deviceStatus, 'fail', e.message)
} }
// TODO: refacto to more generic/global way
if (!this._unmounted) {
this._timeout = setTimeout(this.checkAppOpened, 1e3) this._timeout = setTimeout(this.checkAppOpened, 1e3)
} }
}
_timeout: * _timeout: *
_unmounted = false _unmounted = false

Loading…
Cancel
Save