Skip to content

Commit 35efc11

Browse files
committed
Fix Members are displayed with a fallback avatar in Add Approval Workflow
1 parent 3c1d3c5 commit 35efc11

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/components/SelectionList/InviteMemberListItem.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ function InviteMemberListItem<TItem extends ListItem>({
6363
}
6464
}, [item, onCheckboxPress, onSelectRow]);
6565

66+
const firstItemIconID = Number(item?.icons?.at(0)?.id);
67+
68+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
69+
const accountID = !item.reportID ? item.accountID || firstItemIconID : undefined;
70+
6671
return (
6772
<BaseListItem
6873
item={item}
@@ -101,7 +106,7 @@ function InviteMemberListItem<TItem extends ListItem>({
101106
wrapperStyle={styles.productTrainingTooltipWrapper}
102107
>
103108
<View style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]}>
104-
{!!item.icons && (
109+
{(!!item.reportID || !!accountID) && (
105110
<ReportActionAvatars
106111
subscriptAvatarBorderColor={hovered && !isFocused ? hoveredBackgroundColor : subscriptAvatarBorderColor}
107112
shouldShowTooltip={showTooltip}
@@ -112,7 +117,7 @@ function InviteMemberListItem<TItem extends ListItem>({
112117
]}
113118
singleAvatarContainerStyle={[styles.actionAvatar, styles.mr3]}
114119
reportID={item.reportID}
115-
accountIDs={!item.reportID && item.accountID ? [item.accountID] : undefined}
120+
accountIDs={accountID ? [accountID] : undefined}
116121
/>
117122
)}
118123
<View style={[styles.flex1, styles.flexColumn, styles.justifyContentCenter, styles.alignItemsStretch, styles.optionRow]}>

0 commit comments

Comments
 (0)