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} />
-
diff --git a/pages/index.js b/pages/index.js index d0ff70c..1a4066b 100644 --- a/pages/index.js +++ b/pages/index.js @@ -28,7 +28,7 @@ class Index extends React.Component { render() { return ( - + ) }