diff --git a/src/components/UserSettingsProvider.js b/src/components/UserSettingsProvider.js index 35fb4f23b..baacdadaa 100644 --- a/src/components/UserSettingsProvider.js +++ b/src/components/UserSettingsProvider.js @@ -17,11 +17,14 @@ const UserSettingsProvider = ({ children }) => { setSettings({ ...userSettings, - displayProperty: userSettings.keyAnalysisDisplayProperty, + displayProperty: + userSettings.keyAnalysisDisplayProperty === 'name' + ? 'displayName' + : 'displayShortName', }) } fetchData() - }, []) + }, [engine]) return ( { try { const unfilteredDimensions = await apiFetchDimensions( dataEngine, - userSettings.keyAnalysisDisplayProperty + userSettings.displayProperty ) dispatch( @@ -28,14 +28,16 @@ const useDimensions = doFetch => { } } - if ( - !dimensions.length && - doFetch && - userSettings.keyAnalysisDisplayProperty - ) { + if (!dimensions.length && doFetch && userSettings.displayProperty) { fetchDimensions() } - }, [dimensions, doFetch, userSettings.keyAnalysisDisplayProperty]) + }, [ + dimensions, + doFetch, + userSettings.displayProperty, + dataEngine, + dispatch, + ]) return dimensions } diff --git a/src/pages/view/TitleBar/FilterDialog.js b/src/pages/view/TitleBar/FilterDialog.js index 1b8755a95..702acb2fa 100644 --- a/src/pages/view/TitleBar/FilterDialog.js +++ b/src/pages/view/TitleBar/FilterDialog.js @@ -117,9 +117,7 @@ const FilterDialog = ({ dimensionId={dimension.id} onSelect={onSelectItems} dimensionTitle={dimension.name} - displayNameProp={ - userSettings.keyAnalysisDisplayProperty - } + displayNameProp={userSettings.displayProperty} /> ) }