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

Commit

Permalink
Only show client details if available
Browse files Browse the repository at this point in the history
  • Loading branch information
hughns authored and sandhose committed Sep 1, 2023
1 parent cd7f6d6 commit 8a52486
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions frontend/src/components/SessionDetail/CompatSessionDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,31 @@ const CompatSessionDetail: React.FC<Props> = ({ session }) => {
...finishedAt,
];

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

const clientDetails = [
{ label: "Name", value: clientName },
{
if (data.ssoLogin?.redirectUri) {
clientDetails.push({
label: "Name",
value: simplifyUrl(data.ssoLogin.redirectUri),
});
clientDetails.push({
label: "Uri",
value: (
<a target="_blank" href={data.ssoLogin?.redirectUri}>
{data.ssoLogin?.redirectUri}
</a>
),
},
];
});
}

return (
<div>
<BlockList>
<H3>{data.deviceId || data.id}</H3>
<SessionDetails title="Session" details={sessionDetails} />
<SessionDetails title="Client" details={clientDetails} />
{clientDetails.length > 0 ? (
<SessionDetails title="Client" details={clientDetails} />
) : null}
{!data.finishedAt && (
<Button
kind="destructive"
Expand Down

0 comments on commit 8a52486

Please sign in to comment.