From 8e8d61ecfc88aeba6568dd8fd526dcbbed5b8613 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Mon, 16 Sep 2024 10:02:40 +0000 Subject: [PATCH] test --- .../grapher/src/core/Grapher.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index f5db7b3d7e2..a4ba44ee251 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -65,6 +65,7 @@ import { getOriginAttributionFragments, sortBy, extractDetailsFromSyntax, + omit, } from "@ourworldindata/utils" import { MarkdownTextWrap, @@ -505,7 +506,11 @@ export class Grapher if (props) this.setAuthoredVersion(props) - this.updateFromObject(props) + if (props.manager?.selection) { + this.updateFromObject(omit(props, "selectedEntityNames")) + } else { + this.updateFromObject(props) + } if (!props.table) this.downloadData() @@ -559,13 +564,9 @@ export class Grapher // Regression fix: some legacies have this set to Null. Todo: clean DB. if (obj.originUrl === null) this.originUrl = "" - console.group() - console.log("current selection", this.selection.selectedEntityNames) - console.log("obj.selectedEntityNames", obj.selectedEntityNames) - console.groupEnd() - // // update selection - // if (obj.selectedEntityNames) - // this.selection.setSelectedEntities(obj.selectedEntityNames) + // update selection + if (obj.selectedEntityNames) + this.selection.setSelectedEntities(obj.selectedEntityNames) // JSON doesn't support Infinity, so we use strings instead. this.minTime = minTimeBoundFromJSONOrNegativeInfinity(obj.minTime)