From 6e0042d755068fc2c1de067c1ddf954b60cd88c0 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 17 Jan 2016 19:07:19 +0000 Subject: [PATCH] Fix problem caused by unknown reasons --- static/src/js/components/index/project-image.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/static/src/js/components/index/project-image.js b/static/src/js/components/index/project-image.js index cc92ff9..9d37936 100644 --- a/static/src/js/components/index/project-image.js +++ b/static/src/js/components/index/project-image.js @@ -24,14 +24,19 @@ export default class ProjectImage extends React.Component { }) }).then(function (response) { if (response.status === 302) { - this.setState({ url: response.json() }); return response; } else { var error = new Error(response.statusText); error.response = response; throw error; } - }.bind(this)).catch((e) => console.log(e)); + }).then( + (response) => response.json() + ).then(function (url) { + this.setState({ url }); + }.bind(this)).catch(function (error) { + console.log("Got this error:", error); + }); } render() {