Browse Source

sort desc tx history fix

all-modes
pbca26 8 years ago
parent
commit
fcde5b528c
  1. 12
      react/src/components/dashboard/walletsData.js
  2. 12
      react/src/components/dashboard/walletsNativeTxHistory.js

12
react/src/components/dashboard/walletsData.js

@ -151,13 +151,13 @@ class WalletsData extends React.Component {
}
updateInput(e) {
let historyToSplit = this.props.ActiveCoin.txhistory;
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice(0, e.target.value);
this.setState({
[e.target.name]: e.target.value,
activePage: 1,
itemsList: sortByDate(historyToSplit),
itemsList: historyToSplit,
});
}
@ -168,11 +168,11 @@ class WalletsData extends React.Component {
componentWillReceiveProps(props) {
if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory.length) {
if (!this.state.itemsList || (this.state.itemsList && !this.state.itemsList.length) || (props.ActiveCoin.txhistory !== this.props.ActiveCoin.txhistory)) {
let historyToSplit = this.props.ActiveCoin.txhistory;
let historyToSplit = sortByDate(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: sortByDate(historyToSplit),
itemsList: historyToSplit,
}));
}
}
@ -185,12 +185,12 @@ class WalletsData extends React.Component {
}
updateCurrentPage(page) {
let historyToSplit = this.props.ActiveCoin.txhistory;
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice((page - 1) * this.state.itemsPerPage, page * this.state.itemsPerPage);
this.setState(Object.assign({}, this.state, {
activePage: page,
itemsList: sortByDate(historyToSplit),
itemsList: historyToSplit,
}));
}

12
react/src/components/dashboard/walletsNativeTxHistory.js

@ -26,13 +26,13 @@ class WalletsNativeTxHistory extends React.Component {
}
updateInput(e) {
let historyToSplit = this.props.ActiveCoin.txhistory;
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice(0, e.target.value);
this.setState({
[e.target.name]: e.target.value,
activePage: 1,
itemsList: sortByDate(historyToSplit),
itemsList: historyToSplit,
});
}
@ -82,23 +82,23 @@ 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)) {
if (this.props.ActiveCoin.txhistory) {
let historyToSplit = this.props.ActiveCoin.txhistory;
let historyToSplit = sortByDate(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: sortByDate(historyToSplit),
itemsList: historyToSplit,
}));
}
}
}
updateCurrentPage(page) {
let historyToSplit = this.props.ActiveCoin.txhistory;
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice((page - 1) * this.state.itemsPerPage, page * this.state.itemsPerPage);
this.setState(Object.assign({}, this.state, {
activePage: page,
itemsList: sortByDate(historyToSplit),
itemsList: historyToSplit,
}));
}

Loading…
Cancel
Save