Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Sep 16, 2024
1 parent ca9ff4a commit 8e8d61e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/@ourworldindata/grapher/src/core/Grapher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import {
getOriginAttributionFragments,
sortBy,
extractDetailsFromSyntax,
omit,
} from "@ourworldindata/utils"
import {
MarkdownTextWrap,
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8e8d61e

Please sign in to comment.