From 569bb09f945ca0f748fbb66a819610b6e35040a5 Mon Sep 17 00:00:00 2001 From: Hunter Thornsberry Date: Fri, 28 Jun 2024 12:30:06 -0400 Subject: [PATCH] fix sorting --- src/components/generic/Table/index.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/generic/Table/index.tsx b/src/components/generic/Table/index.tsx index fff2cb6a..ec745963 100755 --- a/src/components/generic/Table/index.tsx +++ b/src/components/generic/Table/index.tsx @@ -34,12 +34,8 @@ export const Table = ({ headings, rows }: TableProps): JSX.Element => { // Custom comparison for 'Last Heard' column if (sortColumn === "Last Heard") { - const aTimestamp = a[columnIndex].props.timestamp - ? a[columnIndex].props.timestamp - : 0; - const bTimestamp = b[columnIndex].props.timestamp - ? b[columnIndex].props.timestamp - : 0; + const aTimestamp = aValue.props.timestamp ?? 0; + const bTimestamp = bValue.props.timestamp ?? 0; if (aTimestamp < bTimestamp) { return sortOrder === "asc" ? -1 : 1;