diff --git a/js/actions/piece_list_actions.js b/js/actions/piece_list_actions.js index 2d5f6447..eb9a5403 100644 --- a/js/actions/piece_list_actions.js +++ b/js/actions/piece_list_actions.js @@ -28,7 +28,8 @@ class PieceListActions { 'pieceListCount': res.count }); resolve(); - }); + }) + .catch((err) => reject(err)); }); } fetchPieceRequestActions() { diff --git a/js/components/ascribe_accordion_list/accordion_list.js b/js/components/ascribe_accordion_list/accordion_list.js index 454e6dbc..597581db 100644 --- a/js/components/ascribe_accordion_list/accordion_list.js +++ b/js/components/ascribe_accordion_list/accordion_list.js @@ -6,7 +6,8 @@ let AccordionList = React.createClass({ propTypes: { className: React.PropTypes.string, children: React.PropTypes.arrayOf(React.PropTypes.element).isRequired, - loadingElement: React.PropTypes.element + loadingElement: React.PropTypes.element, + count: React.PropTypes.number }, render() { @@ -16,10 +17,10 @@ let AccordionList = React.createClass({ {this.props.children} ); - } else if(this.props.itemList.length === 0) { + } else if(this.props.count === 0) { return (
-

You don't have any works yet...

+

We could not find any works related to you...

To register one, click here!

); diff --git a/js/components/piece_list.js b/js/components/piece_list.js index 08ac9bab..f0b5a41c 100644 --- a/js/components/piece_list.js +++ b/js/components/piece_list.js @@ -76,6 +76,7 @@ let PieceList = React.createClass({ className="ascribe-accordion-list" changeOrder={this.accordionChangeOrder} itemList={this.state.pieceList} + count={this.state.pieceListCount} orderBy={this.state.orderBy} orderAsc={this.state.orderAsc} search={this.state.search} diff --git a/js/stores/piece_list_store.js b/js/stores/piece_list_store.js index 4e536c26..e18dbc31 100644 --- a/js/stores/piece_list_store.js +++ b/js/stores/piece_list_store.js @@ -19,7 +19,7 @@ class PieceListStore { * the number of items the resource actually - without pagination - provides. */ this.pieceList = []; - this.pieceListCount = 0; + this.pieceListCount = -1; this.page = 1; this.pageSize = 10; this.search = '';