From d28eb0bcc9cb6dcbcd2dac17c315c52cb839a3b0 Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Wed, 5 Dec 2018 11:39:51 -0700 Subject: [PATCH] =?UTF-8?q?Consider=20pre-flight=20wc-api=20requests=20to?= =?UTF-8?q?=20be=20=E2=80=9Crequesting=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/woocommerce-admin/client/wc-api/orders/selectors.js | 6 +----- .../client/wc-api/reports/items/selectors.js | 6 +----- .../client/wc-api/reports/stats/selectors.js | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/plugins/woocommerce-admin/client/wc-api/orders/selectors.js b/plugins/woocommerce-admin/client/wc-api/orders/selectors.js index e1b30b0b077..c47e91f7a44 100644 --- a/plugins/woocommerce-admin/client/wc-api/orders/selectors.js +++ b/plugins/woocommerce-admin/client/wc-api/orders/selectors.js @@ -33,11 +33,7 @@ const isGetOrdersRequesting = getResource => ( query = {} ) => { const resourceName = getResourceName( 'order-query', query ); const { lastRequested, lastReceived } = getResource( resourceName ); - if ( isNil( lastRequested ) ) { - return false; - } - - if ( isNil( lastReceived ) ) { + if ( isNil( lastRequested ) || isNil( lastReceived ) ) { return true; } diff --git a/plugins/woocommerce-admin/client/wc-api/reports/items/selectors.js b/plugins/woocommerce-admin/client/wc-api/reports/items/selectors.js index 0ae60913b0b..f96574b82e9 100644 --- a/plugins/woocommerce-admin/client/wc-api/reports/items/selectors.js +++ b/plugins/woocommerce-admin/client/wc-api/reports/items/selectors.js @@ -26,11 +26,7 @@ const isGetReportItemsRequesting = getResource => ( type, query = {} ) => { const resourceName = getResourceName( `report-items-query-${ type }`, query ); const { lastRequested, lastReceived } = getResource( resourceName ); - if ( isNil( lastRequested ) ) { - return false; - } - - if ( isNil( lastReceived ) ) { + if ( isNil( lastRequested ) || isNil( lastReceived ) ) { return true; } diff --git a/plugins/woocommerce-admin/client/wc-api/reports/stats/selectors.js b/plugins/woocommerce-admin/client/wc-api/reports/stats/selectors.js index fe819d2aa66..8aa827ccf9a 100644 --- a/plugins/woocommerce-admin/client/wc-api/reports/stats/selectors.js +++ b/plugins/woocommerce-admin/client/wc-api/reports/stats/selectors.js @@ -26,11 +26,7 @@ const isReportStatsRequesting = getResource => ( type, query = {} ) => { const resourceName = getResourceName( `report-stats-query-${ type }`, query ); const { lastRequested, lastReceived } = getResource( resourceName ); - if ( isNil( lastRequested ) ) { - return false; - } - - if ( isNil( lastReceived ) ) { + if ( isNil( lastRequested ) || isNil( lastReceived ) ) { return true; }