Skip to content

Commit

Permalink
fix: optional chaining on item avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
zovomat committed Mar 28, 2022
1 parent 2bb5d32 commit a63d411
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/views/app/folder-panel/lists-item/item-avatar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const ItemAvatar = ({ item, selected, selecting, toggle, folderId, isSear
const targetParticipants = folderId === '5' ? ParticipantRole.TO : ParticipantRole.FROM;
const [t] = useTranslation();
const [avatarLabel, avatarEmail] = useMemo(() => {
let sender = item.participants.find((p) => p.type === targetParticipants);
let sender = item?.participants?.find((p) => p.type === targetParticipants);
if (!sender) [sender] = item.participants;
return [sender.fullName || sender.name || sender.address || '.', sender.address];
}, [item.participants, targetParticipants]);
Expand Down

0 comments on commit a63d411

Please sign in to comment.