From 974132f78809d6062e4480d2dbce6efc1ee9880d Mon Sep 17 00:00:00 2001 From: polaris Date: Sun, 7 Jul 2024 11:49:52 -0400 Subject: [PATCH] sorting variable name cleanup --- components/scoreplaylog/colums.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/scoreplaylog/colums.tsx b/components/scoreplaylog/colums.tsx index 293fd35..285ba93 100644 --- a/components/scoreplaylog/colums.tsx +++ b/components/scoreplaylog/colums.tsx @@ -65,7 +65,7 @@ export const columns: ColumnDef[] = [ if (highScore < lowScore) return 1; if (highScore > lowScore) return -1; - + // TODO: FIGURE OUT DEFAULT SORT return 0; }, }, @@ -126,12 +126,11 @@ export const columns: ColumnDef[] = [ ), sortingFn: (a, b) => { - const isAllJusticeA = a.original.isAllJustice; - const isAllJusticeB = b.original.isAllJustice; + const isAllJustice = a.original.isAllJustice; + const defaultSort = b.original.isAllJustice; - // Show All Justice entries first - if (isAllJusticeA && !isAllJusticeB) return -1; - if (!isAllJusticeA && isAllJusticeB) return 1; + if (isAllJustice && !defaultSort) return -1; + if (!isAllJustice && defaultSort) return 1; return 0; }, },