Skip to content

Commit

Permalink
🔨 fix a subtle bug that opened the wrong covid explorer view in redir…
Browse files Browse the repository at this point in the history
…ects
  • Loading branch information
danyx23 committed Dec 6, 2023
1 parent 906129a commit f44f668
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions explorer/urlMigrations/LegacyCovidUrlMigration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const covidIntervalFromLegacyQueryParams = (queryParams: QueryParams) => {
}

const boolParamToString = (bool: boolean | string | undefined) =>
bool ? "true" : "false"
bool === "true" || bool === "false" ? bool : bool ? "true" : "false"

const legacyToCurrentCovidQueryParams = (
queryParams: QueryParams,
Expand Down Expand Up @@ -101,16 +101,16 @@ const legacyToCurrentCovidQueryParams = (
"Align outbreaks": boolParamToString(
queryParams["Align outbreaks"] ??
baseQueryParams["Align outbreaks"] ??
urlContainsMetric
? queryParams.aligned
: baseQueryParams.aligned
(urlContainsMetric
? queryParams.aligned
: baseQueryParams.aligned)
),
"Relative to Population": boolParamToString(
queryParams["Relative to Population"] ??
baseQueryParams["Relative to Population"] ??
urlContainsMetric
? queryParams.perCapita
: baseQueryParams.perCapita
(urlContainsMetric
? queryParams.perCapita
: baseQueryParams.perCapita)
),
}

Expand Down

0 comments on commit f44f668

Please sign in to comment.