From ce5cc92aa3f6ce067ff533750f06f5f04e0ea3b0 Mon Sep 17 00:00:00 2001 From: Michael Fix Date: Tue, 17 Apr 2018 19:20:42 -0700 Subject: [PATCH] Editor refactors (#336) --- components/Editor.js | 23 +++++++++++------------ pages/index.js | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) 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 ( - + ) }