|
|
|
@ -818,8 +818,9 @@ function sortTable(column) {
|
|
|
|
|
if (!table) throw new Error("Table missing");
|
|
|
|
|
const sortState = getSortState(table);
|
|
|
|
|
const sortingAsBefore = column === undefined;
|
|
|
|
|
if (!sortState && !sortingAsBefore) {
|
|
|
|
|
throw new Error("Must supply column on first sort");
|
|
|
|
|
if (!sortState && sortingAsBefore) {
|
|
|
|
|
// No column supplied on first sort
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const sortingNewColumn = column !== sortState?.column;
|
|
|
|
|
const sortedColumn = column ?? sortState?.column ?? unreachable();
|
|
|
|
|