Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(grapher refactor): fix time param handling #4639

Open
wants to merge 2 commits into
base: fix-grapher-uses
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,7 @@ describe("time parameter", () => {
minTime: 0,
maxTime: 75,
})
expect(grapher.hasUserChangedTimeHandles).toBe(false)
expect(grapher.changedParams.time).toEqual(undefined)
})

Expand All @@ -768,6 +769,7 @@ describe("time parameter", () => {
minTime: undefined,
maxTime: 75,
})
expect(grapher.hasUserChangedTimeHandles).toBe(false)
expect(grapher.changedParams.time).toEqual(undefined)
})
})
Expand Down
4 changes: 2 additions & 2 deletions packages/@ourworldindata/grapher/src/core/Grapher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2696,8 +2696,8 @@ export class GrapherState {
return this.manager?.embedDialogAdditionalElements
}

@computed private get hasUserChangedTimeHandles(): boolean {
const authorsVersion = this.legacyConfigAsAuthored
@computed get hasUserChangedTimeHandles(): boolean {
const authorsVersion = this.authorsVersion
return (
this.minTime !== authorsVersion.minTime ||
this.maxTime !== authorsVersion.maxTime
Expand Down
Loading