From 1c52bcedc8333cd0e647ee1a308ab2906ec88724 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Thu, 18 Jan 2018 10:13:51 -0800 Subject: [PATCH] changed componentwillmount to componentdidmount --- react/components/Preview.jsx | 4 +--- react/components/ProgressBar.jsx | 2 +- react/components/PublishUrlMiddle.jsx | 4 ++-- react/containers/ChannelSelect/view.jsx | 3 +-- react/containers/PublishForm/view.jsx | 2 +- react/containers/PublishUrlInput/view.jsx | 2 +- react/utils/file.js | 2 +- 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/react/components/Preview.jsx b/react/components/Preview.jsx index 6c0b8a67..8b17714b 100644 --- a/react/components/Preview.jsx +++ b/react/components/Preview.jsx @@ -10,12 +10,10 @@ class Preview extends React.Component { }; this.previewFile = this.previewFile.bind(this); } - componentWillMount () { - console.log('Preview will mount'); + componentDidMount () { this.previewFile(this.props.file); } componentWillReceiveProps (newProps) { - console.log('Preview will receive props', newProps); if (newProps.file !== this.props.file) { this.previewFile(newProps.file); } diff --git a/react/components/ProgressBar.jsx b/react/components/ProgressBar.jsx index 3efc7fb0..9084a221 100644 --- a/react/components/ProgressBar.jsx +++ b/react/components/ProgressBar.jsx @@ -21,7 +21,7 @@ class ProgressBar extends React.Component { this.updateProgressBar = this.updateProgressBar.bind(this); this.stopProgressBar = this.stopProgressBar.bind(this); } - componentWillMount () { + componentDidMount () { const bars = []; for (let i = 0; i <= this.state.size; i++) { bars.push(); diff --git a/react/components/PublishUrlMiddle.jsx b/react/components/PublishUrlMiddle.jsx index 9e049fe1..3aff973b 100644 --- a/react/components/PublishUrlMiddle.jsx +++ b/react/components/PublishUrlMiddle.jsx @@ -16,8 +16,8 @@ function UrlMiddle ({publishInChannel, loggedInChannelName, loggedInChannelShort UrlMiddle.propTypes = { publishInChannel : PropTypes.bool.isRequired, - loggedInChannelName : PropTypes.string.isRequired, - loggedInChannelShortId: PropTypes.string.isRequired, + loggedInChannelName : PropTypes.string, + loggedInChannelShortId: PropTypes.string, }; export default UrlMiddle; diff --git a/react/containers/ChannelSelect/view.jsx b/react/containers/ChannelSelect/view.jsx index ea0f3999..745949de 100644 --- a/react/containers/ChannelSelect/view.jsx +++ b/react/containers/ChannelSelect/view.jsx @@ -15,8 +15,7 @@ class ChannelSelect extends React.Component { this.handleSelection = this.handleSelection.bind(this); this.selectOption = this.selectOption.bind(this); } - componentWillMount () { - console.log('ChannelSelector will mount'); + componentDidMount () { if (this.props.loggedInChannelName) { this.selectOption(this.props.loggedInChannelName); } diff --git a/react/containers/PublishForm/view.jsx b/react/containers/PublishForm/view.jsx index ada35635..d0d270f9 100644 --- a/react/containers/PublishForm/view.jsx +++ b/react/containers/PublishForm/view.jsx @@ -15,7 +15,7 @@ class PublishForm extends React.Component { this.makePublishRequest = this.makePublishRequest.bind(this); this.publish = this.publish.bind(this); } - componentWillMount () { + componentDidMount () { // check for whether a channel is already logged in const loggedInChannelName = getCookie('channel_name'); const loggedInChannelShortId = getCookie('short_channel_id'); diff --git a/react/containers/PublishUrlInput/view.jsx b/react/containers/PublishUrlInput/view.jsx index 8bb1c22d..b01742e2 100644 --- a/react/containers/PublishUrlInput/view.jsx +++ b/react/containers/PublishUrlInput/view.jsx @@ -14,7 +14,7 @@ class PublishUrlInput extends React.Component { this.setClaimNameFromFileName = this.setClaimNameFromFileName.bind(this); this.checkClaimIsAvailable = this.checkClaimIsAvailable.bind(this); } - componentWillMount () { + componentDidMount () { if (!this.props.claim || this.props.claim === '') { this.setClaimNameFromFileName(); } diff --git a/react/utils/file.js b/react/utils/file.js index 4a054f33..7d2c706d 100644 --- a/react/utils/file.js +++ b/react/utils/file.js @@ -21,7 +21,7 @@ module.exports = { case 'image/gif': if (file.size > 50000000) { console.log('file was too big'); - throw new Error('Sorry, .gifs are limited to 50 megabytes.'); + throw new Error('Sorry, GIFs are limited to 50 megabytes.'); } break; case 'video/mp4':