diff --git a/components/Editor.js b/components/Editor.js index 3b08b2a..9ead294 100644 --- a/components/Editor.js +++ b/components/Editor.js @@ -148,12 +148,9 @@ class Editor extends React.Component { upload() { this.setState({ uploading: true }) this.getCarbonImage({ format: 'png' }) - .then(api.tweet) + .then(this.props.tweet) + .catch(console.error) .then(() => this.setState({ uploading: false })) - .catch(err => { - console.error(err) - this.setState({ uploading: false }) - }) } onDrop([file]) { @@ -219,13 +216,15 @@ class Editor extends React.Component { resetDefaultSettings={this.resetDefaultSettings} />