sorting variable name cleanup

This commit is contained in:
polaris
2024-07-07 11:49:52 -04:00
parent df7646ddeb
commit 974132f788

View File

@ -65,7 +65,7 @@ export const columns: ColumnDef<chunithm>[] = [
if (highScore < lowScore) return 1; if (highScore < lowScore) return 1;
if (highScore > lowScore) return -1; if (highScore > lowScore) return -1;
// TODO: FIGURE OUT DEFAULT SORT
return 0; return 0;
}, },
}, },
@ -126,12 +126,11 @@ export const columns: ColumnDef<chunithm>[] = [
</div> </div>
), ),
sortingFn: (a, b) => { sortingFn: (a, b) => {
const isAllJusticeA = a.original.isAllJustice; const isAllJustice = a.original.isAllJustice;
const isAllJusticeB = b.original.isAllJustice; const defaultSort = b.original.isAllJustice;
// Show All Justice entries first if (isAllJustice && !defaultSort) return -1;
if (isAllJusticeA && !isAllJusticeB) return -1; if (!isAllJustice && defaultSort) return 1;
if (!isAllJusticeA && isAllJusticeB) return 1;
return 0; return 0;
}, },
}, },