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)