diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index 99256c311..62e2e812c 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -179,7 +179,9 @@ const AdvancedSettingsPanel = ({ ) useEffect(() => { + console.log('mobilityProfile', mobilityProfile) if (mobilityProfile && dependents.length > 0) { + console.log('test') getDependentUserInfo(dependents, intl) } }, [dependents, getDependentUserInfo, intl, mobilityProfile]) @@ -251,16 +253,6 @@ const AdvancedSettingsPanel = ({ closePanel() }, [closePanel, setCloseAdvancedSettingsWithDelay]) - const showMobilityProfileDropdown = () => { - return ( - loggedInUser && - loggedInUser.mobilityProfile && - loggedInUser.mobilityProfile.mobilityMode && - loggedInUser.dependents && - loggedInUser.dependents.length > 0 - ) - } - return ( @@ -289,43 +281,45 @@ const AdvancedSettingsPanel = ({ )} - {showMobilityProfileDropdown() && loggedInUser && ( - - - - - ( - - {linkText} - - ) - }} - /> - { - setSelectedMobilityProfile(e.mobilityProfile as string) - }} - options={[ - { - text: 'Myself', - value: loggedInUser.mobilityProfile?.mobilityMode || '' - }, - ...(loggedInUser.dependentsInfo?.map((user) => ({ - text: user.name || user.email, - value: user.mobilityMode || '' - })) || []) - ]} - value={selectedMobilityProfile} - /> - - )} + {loggedInUser && + loggedInUser.dependentsInfo && + loggedInUser.dependentsInfo.length > 0 && ( + + + + + ( + + {linkText} + + ) + }} + /> + { + setSelectedMobilityProfile(e.mobilityProfile as string) + }} + options={[ + { + text: 'Myself', + value: loggedInUser.mobilityProfile?.mobilityMode || '' + }, + ...(loggedInUser.dependentsInfo?.map((user) => ({ + text: user.name || user.email, + value: user.mobilityMode || '' + })) || []) + ]} + value={selectedMobilityProfile} + /> + + )} ) } + const queryParamConfig = { modeButtons: DelimitedArrayParam } const mapStateToProps = (state: AppReduxState) => {