Skip to content

Commit

Permalink
Merge pull request #268 from scottbenton/fix/custom-track-issue
Browse files Browse the repository at this point in the history
fix(custom tracks): Fixed custom tracks breaking when the same value …
  • Loading branch information
scottbenton authored Oct 29, 2023
2 parents 06cae5f + 069b094 commit a9c04dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ export function CustomTrack(props: CustomTrackProps) {
exclusive
disabled={disabled || loading}
value={value}
onChange={(evt, value) => onChange(value)}
onChange={(evt, newValue) => {
if (newValue !== undefined && newValue !== null) {
onChange(newValue);
}
}}
sx={[
{
width: "100%",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export function StatsSection() {
label={track.label}
value={
customTrackValues[track.label] !== undefined &&
customTrackValues[track.label] !== null &&
typeof track.values[customTrackValues[track.label]].value ===
"number"
? (track.values[customTrackValues[track.label]].value as number)
Expand Down

0 comments on commit a9c04dc

Please sign in to comment.