Skip to content

Commit

Permalink
Merge pull request #163 from tokenman-dev/fix/history-all-days
Browse files Browse the repository at this point in the history
Fix: 'All Days' filter on history page fixed
  • Loading branch information
josadcha committed Jun 15, 2020
2 parents 23d5792 + ecfe55f commit 88e05b0
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/custom/containers/AuctionHistory/index.tsx
Expand Up @@ -88,7 +88,7 @@ class HistoryComponent extends React.Component<Props, State> {

this.state = {
searchFieldValue: '',
daysTab: 'all',
daysTab: '',
date: undefined,
time_from: Date.now() - 1000 * 60 * 60 * 24 * 7,
time_to: Date.now(),
Expand Down Expand Up @@ -389,19 +389,8 @@ class HistoryComponent extends React.Component<Props, State> {
this.setState({
daysTab: filter,
});
const { searchFieldValue } = this.state;
const search = searchFieldValue.toLowerCase();
let filterPayload: {} = { page: 0, limit: STORAGE_DEFAULT_LIMIT, field: 'created_at', order_by: 'desc' };

if (search !== '') {
filterPayload = { ...filterPayload, search };
}

if (filter === 'thirty') {
this.handleApplyFilter('date', filter);
} else {
this.props.fetchCopyrightHistory(filterPayload);
}
this.handleApplyFilter('date', filter);
}

private handleApplyFilter = (key: string, value, from?, to?) => {
Expand Down Expand Up @@ -443,6 +432,7 @@ class HistoryComponent extends React.Component<Props, State> {
timeFrom = Math.floor((Date.now() - 1000 * 60 * 60 * 24 * 30) / 1000);
break;
default:
timeFrom = 0;
break;
}

Expand Down

0 comments on commit 88e05b0

Please sign in to comment.