Skip to content

Commit

Permalink
enhance: eagerly provide current grapher table as pickerTable
Browse files Browse the repository at this point in the history
so sorting by entity name immediately infers the correct alphabetical sort order
  • Loading branch information
marcelgerber committed Sep 26, 2023
1 parent f168b4b commit 027561d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions explorer/Explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -952,14 +952,14 @@ export class Explorer
})

private updateEntityPickerTable(): void {
if (this.entityPickerMetric) {
this.entityPickerTableIsLoading = true
this.futureEntityPickerTable.set(
this.tableLoader.get(
this.getTableSlugOfColumnSlug(this.entityPickerMetric)
)
)
}
// If we don't currently have a entity picker metric, then set pickerTable to the currently-used table anyways,
// so that when we start sorting by entity name we can infer that the column is a string column immediately.
const tableSlugToLoad = this.entityPickerMetric
? this.getTableSlugOfColumnSlug(this.entityPickerMetric)
: this.explorerProgram.grapherConfig.tableSlug

this.entityPickerTableIsLoading = true
this.futureEntityPickerTable.set(this.tableLoader.get(tableSlugToLoad))
}

setEntityPicker({
Expand Down

0 comments on commit 027561d

Please sign in to comment.