Browse Source

fix sorting

pull/258/head
Hunter Thornsberry 2 years ago
parent
commit
569bb09f94
  1. 8
      src/components/generic/Table/index.tsx

8
src/components/generic/Table/index.tsx

@ -34,12 +34,8 @@ export const Table = ({ headings, rows }: TableProps): JSX.Element => {
// Custom comparison for 'Last Heard' column // Custom comparison for 'Last Heard' column
if (sortColumn === "Last Heard") { if (sortColumn === "Last Heard") {
const aTimestamp = a[columnIndex].props.timestamp const aTimestamp = aValue.props.timestamp ?? 0;
? a[columnIndex].props.timestamp const bTimestamp = bValue.props.timestamp ?? 0;
: 0;
const bTimestamp = b[columnIndex].props.timestamp
? b[columnIndex].props.timestamp
: 0;
if (aTimestamp < bTimestamp) { if (aTimestamp < bTimestamp) {
return sortOrder === "asc" ? -1 : 1; return sortOrder === "asc" ? -1 : 1;

Loading…
Cancel
Save