From a8400cbb4fa72d1d2413a75d5706420aec877cac Mon Sep 17 00:00:00 2001 From: Petr Balashov Date: Mon, 24 Apr 2017 02:03:53 -0700 Subject: [PATCH 01/14] props check in native wallet tx history --- .../dashboard/walletsNativeTxHistory.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/react/src/components/dashboard/walletsNativeTxHistory.js b/react/src/components/dashboard/walletsNativeTxHistory.js index 860827e..f90e2a6 100644 --- a/react/src/components/dashboard/walletsNativeTxHistory.js +++ b/react/src/components/dashboard/walletsNativeTxHistory.js @@ -80,12 +80,14 @@ class WalletsNativeTxHistory extends React.Component { componentWillReceiveProps(props) { if (!this.state.itemsList || (this.state.itemsList && !this.state.itemsList.length) || (props.ActiveCoin.txhistory !== this.props.ActiveCoin.txhistory)) { - let historyToSplit = this.props.ActiveCoin.txhistory; - historyToSplit = historyToSplit.slice((this.state.activePage - 1) * this.state.itemsPerPage, this.state.activePage * this.state.itemsPerPage); + if (this.props.ActiveCoin.txhistory) { + let historyToSplit = this.props.ActiveCoin.txhistory; + historyToSplit = historyToSplit.slice((this.state.activePage - 1) * this.state.itemsPerPage, this.state.activePage * this.state.itemsPerPage); - this.setState(Object.assign({}, this.state, { - itemsList: historyToSplit, - })); + this.setState(Object.assign({}, this.state, { + itemsList: historyToSplit, + })); + } } } @@ -114,7 +116,7 @@ class WalletsNativeTxHistory extends React.Component { } renderPaginationItemsPerPageSelector() { - if (this.props.ActiveCoin.txhistory.length > 10) { + if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory.length > 10) { return (