Consider pre-flight wc-api requests to be “requesting”.

This commit is contained in:
Jeff Stieler 2018-12-05 11:39:51 -07:00
parent 16f24a31ba
commit d28eb0bcc9
3 changed files with 3 additions and 15 deletions

View File

@ -33,11 +33,7 @@ const isGetOrdersRequesting = getResource => ( query = {} ) => {
const resourceName = getResourceName( 'order-query', query ); const resourceName = getResourceName( 'order-query', query );
const { lastRequested, lastReceived } = getResource( resourceName ); const { lastRequested, lastReceived } = getResource( resourceName );
if ( isNil( lastRequested ) ) { if ( isNil( lastRequested ) || isNil( lastReceived ) ) {
return false;
}
if ( isNil( lastReceived ) ) {
return true; return true;
} }

View File

@ -26,11 +26,7 @@ const isGetReportItemsRequesting = getResource => ( type, query = {} ) => {
const resourceName = getResourceName( `report-items-query-${ type }`, query ); const resourceName = getResourceName( `report-items-query-${ type }`, query );
const { lastRequested, lastReceived } = getResource( resourceName ); const { lastRequested, lastReceived } = getResource( resourceName );
if ( isNil( lastRequested ) ) { if ( isNil( lastRequested ) || isNil( lastReceived ) ) {
return false;
}
if ( isNil( lastReceived ) ) {
return true; return true;
} }

View File

@ -26,11 +26,7 @@ const isReportStatsRequesting = getResource => ( type, query = {} ) => {
const resourceName = getResourceName( `report-stats-query-${ type }`, query ); const resourceName = getResourceName( `report-stats-query-${ type }`, query );
const { lastRequested, lastReceived } = getResource( resourceName ); const { lastRequested, lastReceived } = getResource( resourceName );
if ( isNil( lastRequested ) ) { if ( isNil( lastRequested ) || isNil( lastReceived ) ) {
return false;
}
if ( isNil( lastReceived ) ) {
return true; return true;
} }