1
Fork 0

Fix problem caused by unknown reasons

This commit is contained in:
Jake Howard 2016-01-17 19:07:19 +00:00
parent 22347d894c
commit 6e0042d755

View file

@ -24,14 +24,19 @@ export default class ProjectImage extends React.Component {
}) })
}).then(function (response) { }).then(function (response) {
if (response.status === 302) { if (response.status === 302) {
this.setState({ url: response.json() });
return response; return response;
} else { } else {
var error = new Error(response.statusText); var error = new Error(response.statusText);
error.response = response; error.response = response;
throw error; 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() { render() {