Browse Source

flow fixes and cleartimeout on close

gre-patch-1
Valentin D. Pinkman 6 years ago
parent
commit
b210111392
No known key found for this signature in database GPG Key ID: E7D110669FFB8D3E
  1. 2
      src/components/SettingsPage/RepairDeviceButton.js

2
src/components/SettingsPage/RepairDeviceButton.js

@ -42,9 +42,11 @@ class RepairDeviceButton extends PureComponent<Props, State> {
open = () => this.setState({ opened: true, error: null }) open = () => this.setState({ opened: true, error: null })
sub: * sub: *
timeout: *
close = () => { close = () => {
if (this.sub) this.sub.unsubscribe() if (this.sub) this.sub.unsubscribe()
if (this.timeout) clearTimeout(this.timeout)
this.setState({ opened: false, isLoading: false, error: null, progress: 0 }) this.setState({ opened: false, isLoading: false, error: null, progress: 0 })
} }

Loading…
Cancel
Save