@@ -13,7 +13,6 @@ import useLocalize from '@hooks/useLocalize';
1313import useOnyx from '@hooks/useOnyx' ;
1414import useThemeStyles from '@hooks/useThemeStyles' ;
1515import { changeDomainSecurityGroup } from '@libs/actions/Domain' ;
16- import { getLoginByAccountID } from '@libs/PersonalDetailsUtils' ;
1716import Navigation from '@navigation/Navigation' ;
1817import type { PlatformStackScreenProps } from '@navigation/PlatformStackNavigation/types' ;
1918import type { SettingsNavigatorParamList } from '@navigation/types' ;
@@ -22,6 +21,7 @@ import CONST from '@src/CONST';
2221import ONYXKEYS from '@src/ONYXKEYS' ;
2322import ROUTES from '@src/ROUTES' ;
2423import type SCREENS from '@src/SCREENS' ;
24+ import { personalDetailsLoginSelector } from '@src/selectors/PersonalDetails' ;
2525import type { Domain } from '@src/types/onyx' ;
2626
2727type SecurityGroupItem = ListItem & {
@@ -43,7 +43,7 @@ function MoveUserBetweenGroupsPage({route}: MoveUserBetweenGroupsPageProps) {
4343 const [ userSecurityGroup ] = useOnyx ( `${ ONYXKEYS . COLLECTION . DOMAIN } ${ domainAccountID } ` , {
4444 selector : securityGroupSelector ,
4545 } ) ;
46- const memberLogin = getLoginByAccountID ( accountID ) ;
46+ const [ memberLogin ] = useOnyx ( ONYXKEYS . PERSONAL_DETAILS_LIST , { selector : personalDetailsLoginSelector ( accountID ) } ) ;
4747
4848 const currentGroupId = userSecurityGroup ?. key . replace ( CONST . DOMAIN . DOMAIN_SECURITY_GROUP_PREFIX , '' ) ;
4949
@@ -86,7 +86,7 @@ function MoveUserBetweenGroupsPage({route}: MoveUserBetweenGroupsPageProps) {
8686 Navigation . goBack ( ROUTES . DOMAIN_MEMBER_DETAILS . getRoute ( domainAccountID , accountID ) ) ;
8787 } }
8888 />
89- < Text style = { [ styles . ph5 , styles . pb3 , styles . textSupporting ] } > { translate ( 'domain.members.chooseWhereToMoveName' , { name : getLoginByAccountID ( accountID ) ?? '' } ) } </ Text >
89+ < Text style = { [ styles . ph5 , styles . pb3 , styles . textSupporting ] } > { translate ( 'domain.members.chooseWhereToMoveName' , { name : memberLogin ?? '' } ) } </ Text >
9090
9191 < SelectionList < SecurityGroupItem >
9292 data = { data }
@@ -101,7 +101,7 @@ function MoveUserBetweenGroupsPage({route}: MoveUserBetweenGroupsPageProps) {
101101 pressOnEnter
102102 text = { translate ( 'common.save' ) }
103103 onPress = { handleSave }
104- isDisabled = { ! selectedGroupId || selectedGroupId === currentGroupId }
104+ isDisabled = { ! selectedGroupId || selectedGroupId === currentGroupId || ! memberLogin }
105105 />
106106 </ FixedFooter >
107107 </ ScreenWrapper >
0 commit comments