Skip to content

Commit

Permalink
fix: use displayName and displayShortName to get correct name
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Apr 19, 2024
1 parent 2acf033 commit bf1fc85
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/components/UserSettingsProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const UserSettingsProvider = ({ children }) => {

setSettings({
...userSettings,
displayProperty: userSettings.keyAnalysisDisplayProperty,
displayProperty: userSettings.keyAnalysisDisplayProperty === 'name'
? 'displayName'
: 'displayShortName',
})
}
fetchData()
Expand Down
6 changes: 3 additions & 3 deletions src/modules/useDimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const useDimensions = (doFetch) => {
try {
const unfilteredDimensions = await apiFetchDimensions(
dataEngine,
userSettings.keyAnalysisDisplayProperty
userSettings.displayProperty
)

dispatch(
Expand All @@ -31,11 +31,11 @@ const useDimensions = (doFetch) => {
if (
!dimensions.length &&
doFetch &&
userSettings.keyAnalysisDisplayProperty
userSettings.displayProperty
) {
fetchDimensions()
}
}, [dimensions, doFetch, userSettings.keyAnalysisDisplayProperty])
}, [dimensions, doFetch, userSettings.displayProperty, dispatch, dataEngine])

return dimensions
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/view/TitleBar/FilterDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const FilterDialog = ({
onSelect={onSelectItems}
dimensionTitle={dimension.name}
displayNameProp={
userSettings.keyAnalysisDisplayProperty
userSettings.displayProperty
}
/>
)
Expand Down

0 comments on commit bf1fc85

Please sign in to comment.