Skip to content

Commit

Permalink
fix issue with unhandled exception when removing number entries
Browse files Browse the repository at this point in the history
  • Loading branch information
xinaesthete committed Jan 14, 2025
1 parent 347af99 commit c1a0807
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/react/components/SelectionDialogComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,11 @@ const useBrushX = (

const [debouncedValue] = useDebounce(value, 100, {
equalityFn: (a, b) => {
if (a === null && b === null) return true;
if (a === null || b === null) return false;
//although the type of input argument is [number, number] | null - they are undefined when component is unmounted
//! which causes an exception here which breaks the whole chart
//so rather than checking === null, we check for falsy values
if (!a && !b) return true;
if (!a || !b) return false;
return a[0] === b[0] && a[1] === b[1];
}
});
Expand Down

0 comments on commit c1a0807

Please sign in to comment.