diff --git a/src/components/transactions/index.js b/src/components/transactions/index.js index e36f3a86c3..da50878a96 100644 --- a/src/components/transactions/index.js +++ b/src/components/transactions/index.js @@ -1,4 +1,5 @@ import { connect } from 'react-redux'; +import { withRouter } from 'react-router'; import { translate } from 'react-i18next'; import { transactionsRequested, transactionsReset } from '../../actions/transactions'; import Transactions from './transactions'; @@ -21,4 +22,5 @@ const mapDispatchToProps = dispatch => ({ transactionsReset: data => dispatch(transactionsReset(data)), }); -export default connect(mapStateToProps, mapDispatchToProps)(translate()(Transactions)); + +export default withRouter(connect(mapStateToProps, mapDispatchToProps)(translate()(Transactions))); diff --git a/src/components/transactions/transactionOverview.js b/src/components/transactions/transactionOverview.js index 96d6b55a49..de8ea3e158 100644 --- a/src/components/transactions/transactionOverview.js +++ b/src/components/transactions/transactionOverview.js @@ -11,6 +11,12 @@ class Transactions extends React.Component { constructor(props) { super(props); this.canLoadMore = true; + + this.props.history.listen((location) => { + if (location.pathname === '/main/dashboard') { + this.setActiveFilter(txFilters.all); + } + }); } loadTransactions(filter, offset) { @@ -40,10 +46,6 @@ class Transactions extends React.Component { this.canLoadMore = count === null || count > transactions.length; } - componentWillUnmount() { - this.setActiveFilter(txFilters.all); - } - setActiveFilter(filter) { this.props.transactionsReset({ filter }); this.loadTransactions(filter);