diff --git a/src/components/App.js b/src/components/App.js index 2bb955e..fbda4cd 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -24,7 +24,7 @@ export default class App extends React.Component { SupportStore.listen(this._onChange) } - componentDidUnmount() { + componentWillUnmount() { SupportStore.unlisten(this._onChange) } diff --git a/src/components/ChromeNotice.js b/src/components/ChromeNotice.js index cc5fd66..4bd03ab 100644 --- a/src/components/ChromeNotice.js +++ b/src/components/ChromeNotice.js @@ -4,7 +4,7 @@ import SupportStore from '../stores/SupportStore' function getState() { return { - active: SupportStore.getState().isChrome && DownloadStore.getState().fileSize >= 500000000 + active: SupportStore.getState().isChrome && DownloadStore.getState().fileSize >= 500000000 } } @@ -24,7 +24,7 @@ export default class ChromeNotice extends React.Component { SupportStore.listen(this._onChange) } - componentDidUnmount() { + componentWillUnmount() { DownloadStore.unlisten(this._onChange) SupportStore.unlisten(this._onChange) } diff --git a/src/components/DownloadButton.js b/src/components/DownloadButton.js index 2a3e16c..20a6494 100644 --- a/src/components/DownloadButton.js +++ b/src/components/DownloadButton.js @@ -1,6 +1,10 @@ import React from 'react' export default class DownloadButton extends React.Component { + constructor() { + super() + this.onClick = this.onClick.bind(this) + } onClick(e) { this.props.onClick(e) @@ -9,7 +13,7 @@ export default class DownloadButton extends React.Component { render() { return } diff --git a/src/components/DownloadPage.js b/src/components/DownloadPage.js index 5b02e12..8279246 100644 --- a/src/components/DownloadPage.js +++ b/src/components/DownloadPage.js @@ -17,13 +17,15 @@ export default class DownloadPage extends React.Component { this._onChange = () => { this.setState(DownloadStore.getState()) } + + this.downloadFile = this.downloadFile.bind(this) } componentDidMount() { DownloadStore.listen(this._onChange) } - componentDidUnmount() { + componentWillUnmount() { DownloadStore.unlisten(this._onChange) } @@ -43,7 +45,7 @@ export default class DownloadPage extends React.Component {

Peers: {this.state.peers} · Up: {formatSize(this.state.speedUp)} · Down: {formatSize(this.state.speedDown)}

- + diff --git a/src/components/DropZone.js b/src/components/DropZone.js index 33e3f99..538b447 100644 --- a/src/components/DropZone.js +++ b/src/components/DropZone.js @@ -5,6 +5,11 @@ export default class DropZone extends React.Component { constructor() { super() this.state = { focus: false } + + this.onDragEnter = this.onDragEnter.bind(this) + this.onDragLeave = this.onDragLeave.bind(this) + this.onDragOver = this.onDragOver.bind(this) + this.onDrop = this.onDrop.bind(this) } onDragEnter() { @@ -31,10 +36,10 @@ export default class DropZone extends React.Component { render() { return
+ onDragEnter={this.onDragEnter} + onDragLeave={this.onDragLeave} + onDragOver={this.onDragOver} + onDrop={this.onDrop}>