Skip to content

Commit

Permalink
fix cache sort (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
xieqiancaosissi authored Aug 2, 2024
1 parent 4fe7997 commit 69e8048
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hooks/useTableSorting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import { IOrder, setTableSorting } from "../redux/appSlice";
export function useTableSorting() {
const sorting = useAppSelector(getTableSorting);
const dispatch = useAppDispatch();

const setSorting = (name: string, property: string, order: IOrder) => {
dispatch(setTableSorting({ name, property, order }));
};

if (!sorting.market.property.includes("Money")) {
sorting.market.property = "totalSupplyMoney";
setSorting("market", "totalSupplyMoney", sorting.market.order);
}
return {
sorting,
setSorting,
Expand Down

0 comments on commit 69e8048

Please sign in to comment.