Skip to content

Commit

Permalink
Cleanup code according to Michael's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJamesC committed Sep 13, 2023
1 parent 59f090a commit 6df5c6a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions reports/src/capability/ParticipantSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export const ParticipantSelector = ({
}) => {
const location = useLocation();
const navigate = useNavigate();
const ussId = parseInt(location.pathname.split("/")[1]);
const participantId = parseInt(location.pathname.split("/")[1]);

const handleUsspSelect = (event: SelectChangeEvent<number>) => {
const handleParticipantSelect = (event: SelectChangeEvent<number>) => {
const id = event.target.value;
navigate(`/${id}`);
};
if (hideIfNoParticipant && Number.isNaN(ussId)) {
if (hideIfNoParticipant && Number.isNaN(participantId)) {
return null;
}
return (
Expand All @@ -32,8 +32,8 @@ export const ParticipantSelector = ({
<Select
displayEmpty={true}
label="Participant"
value={ussId}
onChange={handleUsspSelect}
value={participantId}
onChange={handleParticipantSelect}
sx={{ minWidth: 90 }}
>
{report.participants?.map((p, i) => (
Expand Down

0 comments on commit 6df5c6a

Please sign in to comment.