Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit fff51cf

Browse files
committed
tested and working!
1 parent 2774f65 commit fff51cf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/components/HeaderMenu.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
111111
{
112112
onClick: (e: any) => {
113113
const sortArray = generateSortedColumns(initialState, column, true);
114+
// Update state
115+
dispatch({
116+
type: ActionTypes.SET_SORT_BY,
117+
sortArray: sortArray,
118+
});
114119
setSortBy(sortArray);
115120
setExpanded(false);
116121
},

src/components/reducers/DatabaseDispatch.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,8 @@ export function databaseReducer(state: TableDataType, action: ActionType) {
435435
if (sortedColumn) {
436436
column.isSorted = true;
437437
column.isSortedDesc = sortedColumn.desc;
438+
} else {
439+
column.isSorted = false;
438440
}
439441
return column;
440442
});

0 commit comments

Comments
 (0)