1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00

Fix 404 not being detected properly on piece and edition detail

This commit is contained in:
Brett Sun 2016-01-15 13:00:09 +01:00
parent bc7515ffe7
commit 587b58a500
2 changed files with 5 additions and 4 deletions

View File

@ -58,7 +58,8 @@ let EditionContainer = React.createClass({
},
componentDidUpdate() {
const { editionErr } = this.state.editionMeta;
const { err: editionErr } = this.state.editionMeta;
if (editionErr && editionErr.json && editionErr.json.status === 404) {
this.throws(new ResourceNotFoundError(getLangText("Oops, the edition you're looking for doesn't exist.")));
}

View File

@ -96,9 +96,9 @@ let PieceContainer = React.createClass({
},
componentDidUpdate() {
const { pieceMeta: { err: pieceErr } } = this.state;
const { err: pieceErr } = this.state.pieceMeta;
if (pieceErr && pieceErr.status === 404) {
if (pieceErr && pieceErr.json && pieceErr.json.status === 404) {
this.throws(new ResourceNotFoundError(getLangText("Oops, the piece you're looking for doesn't exist.")));
}
},