From ddc617a759d5d042602fc8f35de360d37c820a67 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Wed, 4 Dec 2024 09:05:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20migrate=20configs=20on=20the=20f?= =?UTF-8?q?ly=20when=20fetched=20from=20R2=20(#4225)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/multiembedder/MultiEmbedder.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/site/multiembedder/MultiEmbedder.tsx b/site/multiembedder/MultiEmbedder.tsx index a54d47d2b23..3abc824771e 100644 --- a/site/multiembedder/MultiEmbedder.tsx +++ b/site/multiembedder/MultiEmbedder.tsx @@ -9,6 +9,7 @@ import { hydrateGlobalEntitySelectorIfAny, migrateSelectedEntityNamesParam, SelectionArray, + migrateGrapherConfigToLatestVersion, } from "@ourworldindata/grapher" import { fetchText, @@ -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(