fix: sort explore table null values (#5130)

This commit is contained in:
Charles Bachmeier 2022-11-08 14:41:21 -05:00 committed by GitHub
parent 054d92cb9c
commit 87455fc096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -23,8 +23,8 @@ const compareFloats = (a: number, b: number): 1 | -1 => {
const CollectionTable = ({ data }: { data: CollectionTableColumn[] }) => {
const floorSort = useMemo(() => {
return (rowA: Row<CollectionTableColumn>, rowB: Row<CollectionTableColumn>) => {
const aFloor = BigNumber.from(rowA.original.floor.value)
const bFloor = BigNumber.from(rowB.original.floor.value)
const aFloor = BigNumber.from(rowA.original.floor.value ?? 0)
const bFloor = BigNumber.from(rowB.original.floor.value ?? 0)
return aFloor.gte(bFloor) ? 1 : -1
}