Skip to content

Commit

Permalink
Fix for revenue goals
Browse files Browse the repository at this point in the history
  • Loading branch information
macobo committed Jan 23, 2025
1 parent 954ac98 commit 8281eb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/js/dashboard/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ export function postProcessFilters(filters: Array<Filter>): Array<Filter> {
// goals with the same currency. Used to decide whether to render
// revenue metrics in a dashboard report or not.
export function revenueAvailable(query: DashboardQuery, site: PlausibleSite) {
const revenueGoalsInFilter = site.revenueGoals.filter((rg) => {
const revenueGoalsInFilter = site.revenueGoals.filter((revenueGoal) => {
const goalFilters: Filter[] = getFiltersByKeyPrefix(query, 'goal')

return goalFilters.some(([_op, _key, clauses]) => {
return clauses.includes(rg.display_name)
return goalFilters.some(([operation, _key, clauses]) => {
return [FILTER_OPERATIONS.is, FILTER_OPERATIONS.contains].includes(operation) && clauses.includes(revenueGoal.display_name)
})
})

Expand Down

0 comments on commit 8281eb7

Please sign in to comment.