fix sorting

This commit is contained in:
Hunter Thornsberry
2024-06-20 21:55:30 -04:00
parent 98f8965aed
commit 11fe2fdb35
+2 -2
View File
@@ -34,8 +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 = a[columnIndex].props.timestamp ? a[columnIndex].props.timestamp : 0;
const bTimestamp = b[columnIndex].props.timestamp; 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;