Remove CSV Download button when no data is available (https://github.com/woocommerce/woocommerce-admin/pull/2084)

This commit is contained in:
Hardip Parmar 2019-04-22 08:45:01 +05:30 committed by Joshua T Flowers
parent 19500daad9
commit e39a8e6e35
1 changed files with 2 additions and 1 deletions

View File

@ -88,6 +88,7 @@ class ReportTable extends Component {
const isLoading = isRequesting || tableData.isRequesting || primaryData.isRequesting;
const totals = get( primaryData, [ 'data', 'totals' ], {} );
const totalResults = items.totalResults;
const downloadable = 0 < totalResults;
const { headers, ids, rows, summary } = applyFilters( TABLE_FILTER, {
endpoint: endpoint,
headers: getHeadersContent(),
@ -102,7 +103,7 @@ class ReportTable extends Component {
return (
<TableCard
downloadable
downloadable={ downloadable }
headers={ filteredHeaders }
ids={ ids }
isLoading={ isLoading }