Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gornostal committed Feb 23, 2019
1 parent cf4ec9f commit d4c937d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ export async function getComments(extId) {

const respContentType = resp.headers.get('Content-Type')
if (respContentType !== 'application/json') {
throw new Error(`Unknown Content-Type ${respContentType}`)
const error = { status: 'error' }
throw error
}

return await resp.json()
Expand Down
2 changes: 1 addition & 1 deletion src/comments/withComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function withComments(WrappedComponent) {
render() {
const { comments, ...rest } = this.props
const { fetching, error, payload } = comments
return <WrappedComponent comments={!fetching && !error && payload} {...rest} />
return <WrappedComponent comments={!fetching && !error ? payload : null} {...rest} />
}
}

Expand Down

0 comments on commit d4c937d

Please sign in to comment.