Skip to content

Commit 4afb2c8

Browse files
authored
ref(replay): Inline getUserBadgeUser() (#95453)
The types are not perfect but at this callsite it looks like this: <img width="525" height="415" alt="SCR-20250714-jpda" src="https://github.com/user-attachments/assets/37cc4da1-ba5e-4890-8958-6ce1826acf1e" /> The `is_archived` case doesn't matter because we're checking for that earlier in this cell component. Ideally the types would be refined at this point, but we havn't defined an `ArchivedReplayListRecord` type yet.
1 parent 4298ab0 commit 4afb2c8

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

static/app/components/replays/table/replayTableColumns.tsx

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,16 @@ export const ReplaySessionColumn: ReplayTableColumn = {
485485

486486
return (
487487
<Flex key="session" align="center" gap={space(1)}>
488-
<UserAvatar user={getUserBadgeUser(replay)} size={24} />
488+
<UserAvatar
489+
user={{
490+
username: replay.user?.display_name || '',
491+
email: replay.user?.email || '',
492+
id: replay.user?.id || '',
493+
ip_address: replay.user?.ip || '',
494+
name: replay.user?.username || '',
495+
}}
496+
size={24}
497+
/>
489498
<SubText>
490499
<Flex gap={space(0.5)} align="flex-start">
491500
<DisplayNameLink
@@ -552,24 +561,6 @@ export const ReplaySlowestTransactionColumn: ReplayTableColumn = {
552561
},
553562
};
554563

555-
function getUserBadgeUser(replay: ListRecord) {
556-
return replay.is_archived
557-
? {
558-
username: '',
559-
email: '',
560-
id: '',
561-
ip_address: '',
562-
name: '',
563-
}
564-
: {
565-
username: replay.user?.display_name || '',
566-
email: replay.user?.email || '',
567-
id: replay.user?.id || '',
568-
ip_address: replay.user?.ip || '',
569-
name: replay.user?.username || '',
570-
};
571-
}
572-
573564
const DropdownContainer = styled(Flex)`
574565
flex-direction: column;
575566
justify-content: center;

0 commit comments

Comments
 (0)