Skip to content

Commit

Permalink
Merge pull request #2267 from google/fix/317-adsense-is-zero-data
Browse files Browse the repository at this point in the history
Restore previous isDataZeroAdSense logic
  • Loading branch information
felixarntz authored Oct 26, 2020
2 parents 57efa7c + d0a2ab0 commit 411d5fa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions assets/js/modules/adsense/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ export function reduceAdSenseData( rows ) {
export const isDataZeroAdSense = ( adSenseData, datapoint, dataRequest ) => {
// We only check the last 28 days of earnings because it is the most reliable data point to identify new setups:
// only new accounts or accounts not showing ads would have zero earnings in the last 28 days.

// The 'prev-date-range-placeholder' is dynamically replaced with the previous date range based on the current date range so we need allow it here.
if ( ! dataRequest.data || ! dataRequest.data.dateRange || ( 'last-28-days' !== dataRequest.data.dateRange && 'prev-date-range-placeholder' !== dataRequest.data.dateRange ) ) {
if ( ! dataRequest.data || ! dataRequest.data.dateRange || 'last-28-days' !== dataRequest.data.dateRange ) {
return false;
}

Expand Down

0 comments on commit 411d5fa

Please sign in to comment.