From 85340a91269672813c215c28d366318992a0e0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 2 Dec 2015 12:23:38 +0100 Subject: [PATCH] Fix bug that threw an error when passing nullish prop to PieceListFilterDisplay --- js/components/piece_list.js | 5 ++--- js/components/piece_list_filter_display.js | 2 +- .../whitelabel/wallet/components/market/market_piece_list.js | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/js/components/piece_list.js b/js/components/piece_list.js index 383d870f..9208df92 100644 --- a/js/components/piece_list.js +++ b/js/components/piece_list.js @@ -133,7 +133,7 @@ let PieceList = React.createClass({ const defaultFilterBy = {}; if (filterParams && typeof filterParams.forEach === 'function') { - filterParams.forEach(({ label, items }) => { + filterParams.forEach(({ items }) => { items.forEach((item) => { if (typeof item === 'object' && item.defaultValue) { defaultFilterBy[item.key] = true; @@ -211,7 +211,7 @@ let PieceList = React.createClass({ }, loadPieceList({ page, filterBy = this.state.filterBy, search = this.state.search }) { - let orderBy = this.state.orderBy ? this.state.orderBy : this.props.orderBy; + const orderBy = this.state.orderBy || this.props.orderBy; return PieceListActions.fetchPieceList(page, this.state.pageSize, search, orderBy, this.state.orderAsc, filterBy); @@ -259,7 +259,6 @@ let PieceList = React.createClass({ const availableAcls = getAvailableAcls(selectedEditions, (aclName) => aclName !== 'acl_view'); setDocumentTitle(getLangText('Collection')); - return (
diff --git a/js/components/whitelabel/wallet/components/market/market_piece_list.js b/js/components/whitelabel/wallet/components/market/market_piece_list.js index 64198bb3..8ffab5a5 100644 --- a/js/components/whitelabel/wallet/components/market/market_piece_list.js +++ b/js/components/whitelabel/wallet/components/market/market_piece_list.js @@ -50,7 +50,7 @@ let MarketPieceList = React.createClass({ render() { const { currentUser, whitelabel } = this.state; - let filterParams = undefined; + let filterParams = null; let canLoadPieceList = false; if (currentUser.email && whitelabel.user) {