Skip to content

Commit

Permalink
fix: Display coachco2 CTA if no data in coachco2 like it is supposed to
Browse files Browse the repository at this point in the history
Condition was inverted.
  • Loading branch information
zatteo committed Nov 24, 2023
1 parent ea80df8 commit 661d7e1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const APP_START_COUNT_KEY =

const DISABLED_COUNT_VALUE = -1

const hasAtLeastOneTimeseriesGeojson = async client => {
const hasNoTimeseriesGeojson = async client => {
const existingTimeseriesGeojsonQuery = buildExistingTimeseriesGeojsonQuery()
const { data: timeseries } = await client.fetchQueryAndGetFromState(
existingTimeseriesGeojsonQuery
)

return timeseries.length >= 1
return timeseries.length === 0
}

const isAvailable = async client => {
Expand All @@ -30,7 +30,7 @@ const isAvailable = async client => {
bikegoalSettings.sourceOffer === null ||
(bikegoalSettings.sourceOffer !== null &&
flag('coachco2.bikegoal.enabled'))) &&
(await hasAtLeastOneTimeseriesGeojson(client))
(await hasNoTimeseriesGeojson(client))
)
}

Expand Down

0 comments on commit 661d7e1

Please sign in to comment.