Skip to content

Commit

Permalink
🐛 migrate configs on the fly when fetched from R2 (#4225)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann authored Dec 4, 2024
1 parent d251b43 commit ddc617a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions site/multiembedder/MultiEmbedder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
hydrateGlobalEntitySelectorIfAny,
migrateSelectedEntityNamesParam,
SelectionArray,
migrateGrapherConfigToLatestVersion,
} from "@ourworldindata/grapher"
import {
fetchText,
Expand Down Expand Up @@ -200,8 +201,11 @@ class MultiEmbedder {
} else {
configUrl = `${GRAPHER_DYNAMIC_CONFIG_URL}/${slug}.config.json`
}
const grapherPageConfig = await fetchWithRetry(configUrl).then(
(res) => res.json()
const fetchedGrapherPageConfig = await fetchWithRetry(
configUrl
).then((res) => res.json())
const grapherPageConfig = migrateGrapherConfigToLatestVersion(
fetchedGrapherPageConfig
)

const figureConfigAttr = figure.getAttribute(
Expand Down

0 comments on commit ddc617a

Please sign in to comment.