Align Ads and Métricas on the same paginated ad_daily warehouse.
Ad Tracker only loaded 2000 newest rows, so Brava showed 0 € while Métricas summed the full month. Both now page the same table for the selected range. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -361,8 +361,10 @@ export default function MetricsDashboard({
|
||||
|
||||
const periodTotals = useMemo(() => {
|
||||
let base: MetricTotals;
|
||||
if (rangedDaily.length) {
|
||||
base = metricTotalsFromDaily(rangedDaily);
|
||||
if (dailyRows.length) {
|
||||
base = rangedDaily.length
|
||||
? metricTotalsFromDaily(rangedDaily)
|
||||
: metricTotalsFromDaily([]);
|
||||
} else {
|
||||
const ranged = weeklyRows.filter((r) => {
|
||||
if (!r.week) return false;
|
||||
@@ -372,7 +374,7 @@ export default function MetricsDashboard({
|
||||
base = ranged.length ? sumWeekly(ranged) : month;
|
||||
}
|
||||
return withCohortFromDeals(base, rangedDeals);
|
||||
}, [rangedDaily, rangedDeals, weeklyRows, since, until, month]);
|
||||
}, [dailyRows.length, rangedDaily, rangedDeals, weeklyRows, since, until, month]);
|
||||
|
||||
const rangeDeltas = useMemo(
|
||||
() => buildRangeDeltas(dailyRows, wonDeals, since, until),
|
||||
|
||||
Reference in New Issue
Block a user