From ecfe55fa29ff1a9e8e315695a795b41e12a3ec8e Mon Sep 17 00:00:00 2001 From: Kohelbekker Date: Sun, 14 Jun 2020 15:11:14 +0300 Subject: [PATCH] Fix: 'All Days' filter on history page fixed --- src/custom/containers/AuctionHistory/index.tsx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/custom/containers/AuctionHistory/index.tsx b/src/custom/containers/AuctionHistory/index.tsx index afed63c66..d8c3048b9 100644 --- a/src/custom/containers/AuctionHistory/index.tsx +++ b/src/custom/containers/AuctionHistory/index.tsx @@ -88,7 +88,7 @@ class HistoryComponent extends React.Component { this.state = { searchFieldValue: '', - daysTab: 'all', + daysTab: '', date: undefined, time_from: Date.now() - 1000 * 60 * 60 * 24 * 7, time_to: Date.now(), @@ -389,19 +389,8 @@ class HistoryComponent extends React.Component { 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?) => { @@ -443,6 +432,7 @@ class HistoryComponent extends React.Component { timeFrom = Math.floor((Date.now() - 1000 * 60 * 60 * 24 * 30) / 1000); break; default: + timeFrom = 0; break; }