Skip to content

Commit 5c15f66

Browse files
committed
Fix the "Assigned to" link in round details table leading to a random bot instead of an arenaclient
1 parent ba7bcbc commit 5c15f66

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

aiarena/frontend-spa/src/_pages/Rework/_Round/RoundsTable.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,26 @@ export default function RoundsTable(props: RoundsTableProps) {
224224
const status = info.row.original.status;
225225
if (status === "Finished") {
226226
const label = info.row.original.assignedTo?.username || "";
227-
const href = `/bots/${getIDFromBase64(info.row.original.assignedTo?.id, "UserType")}`;
228-
const aria = `Visit userprofile for ${info.row.original.assignedTo?.id}`;
227+
const arenaClientId = getIDFromBase64(info.row.original.assignedTo?.id, "UserType");
228+
const aria = `Visit arena client profile for ${label}`;
229229

230230
return (
231231
<span className="flex justify-between">
232-
<Link
233-
className="font-semibold text-gray-200 truncate mr-2"
234-
to={href}
235-
role="cell"
236-
aria-label={aria}
237-
title={`${label}`}
238-
>
239-
{label}
240-
</Link>
232+
{arenaClientId ? (
233+
<Link
234+
className="font-semibold text-gray-200 truncate mr-2"
235+
to={reverseUrl("arenaclient", { pk: arenaClientId })}
236+
role="cell"
237+
aria-label={aria}
238+
title={`${label}`}
239+
>
240+
{label}
241+
</Link>
242+
) : (
243+
<span className="font-semibold text-gray-200 truncate mr-2">
244+
{label}
245+
</span>
246+
)}
241247
</span>
242248
);
243249
} else if (status === "Started") {

0 commit comments

Comments
 (0)