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/DownloadPage.js b/src/components/DownloadPage.js index 5b02e12..826ffb1 100644 --- a/src/components/DownloadPage.js +++ b/src/components/DownloadPage.js @@ -23,7 +23,7 @@ export default class DownloadPage extends React.Component { DownloadStore.listen(this._onChange) } - componentDidUnmount() { + componentWillUnmount() { DownloadStore.unlisten(this._onChange) } diff --git a/src/components/ErrorPage.js b/src/components/ErrorPage.js index 3ec3abc..9e54c18 100644 --- a/src/components/ErrorPage.js +++ b/src/components/ErrorPage.js @@ -17,7 +17,7 @@ export default class ErrorPage extends React.Component { ErrorStore.listen(this._onChange) } - componentDidUnmount() { + componentWillUnmount() { ErrorStore.unlisten(this._onChange) } diff --git a/src/components/UploadPage.js b/src/components/UploadPage.js index e7cf192..1bd41ec 100644 --- a/src/components/UploadPage.js +++ b/src/components/UploadPage.js @@ -12,40 +12,40 @@ export default class UploadPage extends React.Component { constructor() { super() this.state = UploadStore.getState() - + this._onChange = () => { this.setState(UploadStore.getState()) } } - + componentDidMount() { UploadStore.listen(this._onChange) } - - componentDidUnmount() { + + componentWillUnmount() { UploadStore.unlisten(this._onChange) } uploadFile(file) { UploadActions.uploadFile(file) } - + handleSelectedFile(event) { let files = event.target.files if (files.length > 0) { UploadActions.uploadFile(files[0]) } } - + render() { switch (this.state.status) { case 'ready': - + return
- + - +

FilePizza

Free peer-to-peer file transfers in your browser.

We never store anything. Files only served fresh.

@@ -57,30 +57,30 @@ export default class UploadPage extends React.Component {

- + case 'processing': return
- + - +

FilePizza

Processing...

- +
- + case 'uploading': return
- +

FilePizza

- +

Send someone this link to download.

This link will work as long as this page is open.

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

- +
} }