Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit 8a52486

Browse files
hughnssandhose
authored andcommitted
Only show client details if available
1 parent cd7f6d6 commit 8a52486

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

frontend/src/components/SessionDetail/CompatSessionDetail.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,28 +54,31 @@ const CompatSessionDetail: React.FC<Props> = ({ session }) => {
5454
...finishedAt,
5555
];
5656

57-
const clientName = data.ssoLogin?.redirectUri
58-
? simplifyUrl(data.ssoLogin.redirectUri)
59-
: undefined;
57+
const clientDetails: { label: string; value: string | JSX.Element }[] = [];
6058

61-
const clientDetails = [
62-
{ label: "Name", value: clientName },
63-
{
59+
if (data.ssoLogin?.redirectUri) {
60+
clientDetails.push({
61+
label: "Name",
62+
value: simplifyUrl(data.ssoLogin.redirectUri),
63+
});
64+
clientDetails.push({
6465
label: "Uri",
6566
value: (
6667
<a target="_blank" href={data.ssoLogin?.redirectUri}>
6768
{data.ssoLogin?.redirectUri}
6869
</a>
6970
),
70-
},
71-
];
71+
});
72+
}
7273

7374
return (
7475
<div>
7576
<BlockList>
7677
<H3>{data.deviceId || data.id}</H3>
7778
<SessionDetails title="Session" details={sessionDetails} />
78-
<SessionDetails title="Client" details={clientDetails} />
79+
{clientDetails.length > 0 ? (
80+
<SessionDetails title="Client" details={clientDetails} />
81+
) : null}
7982
{!data.finishedAt && (
8083
<Button
8184
kind="destructive"

0 commit comments

Comments
 (0)