Skip to content

Commit

Permalink
Fix users selection
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstotsky committed Dec 8, 2022
1 parent b22d23b commit 8711438
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class SubUsersAdd extends PureComponent {
apiSecret: PropTypes.string,
})).isRequired,
addMultipleAccsEnabled: PropTypes.bool.isRequired,
shouldFilterCurrentUser: PropTypes.bool.isRequired,
masterAccount: PropTypes.string,
authData: PropTypes.shape({
email: PropTypes.string,
Expand Down Expand Up @@ -98,13 +99,15 @@ class SubUsersAdd extends PureComponent {
authData,
masterAccount,
addMultipleAccsEnabled,
shouldFilterCurrentUser,
} = this.props
const { email: currentUserEmail } = authData

const subAccountOptions = users.filter((account) => (
!account.isSubAccount
&& account.email !== currentUserEmail
&& account.email !== masterAccount))
&& account.email !== masterAccount
&& (shouldFilterCurrentUser ? account.email !== currentUserEmail : true)
))
const takenAccountOptions = this.getTakenAccountOptions(accounts)
const selectClassName = addMultipleAccsEnabled
? 'sub-account-create-select' : 'bitfinex-auth-email'
Expand All @@ -131,6 +134,8 @@ class SubUsersAdd extends PureComponent {
...accountOptions,
]

console.log('+++subAccountOptionsItems', subAccountOptionsItems)

return (
/* eslint-disable-next-line react/no-array-index-key */
<div className='sub-users-add-accounts-account' key={index}>
Expand Down

0 comments on commit 8711438

Please sign in to comment.