Reset monitor pages when sorting
This commit is contained in:
1 parent
2a45b4d46f
commit
22d0123966
1 file changed
+8
-12
@@ -140,19 +140,15 @@ export const useMonitorListController = (config: MonitorListConfig) => {
|
|||||||
setPage(0);
|
setPage(0);
|
||||||
};
|
};
|
||||||
|
|
||||||
const setSortField = useCallback(
|
const setSortField = (value: string) => {
|
||||||
(value: string) => {
|
dispatch(setTableSortField({ value, table: config.rowsPerPageTable }));
|
||||||
dispatch(setTableSortField({ value, table: config.rowsPerPageTable }));
|
setPage(0);
|
||||||
},
|
};
|
||||||
[config.rowsPerPageTable, dispatch]
|
|
||||||
);
|
|
||||||
|
|
||||||
const setSortOrder = useCallback(
|
const setSortOrder = (value: "asc" | "desc") => {
|
||||||
(value: "asc" | "desc") => {
|
dispatch(setTableSortOrder({ value, table: config.rowsPerPageTable }));
|
||||||
dispatch(setTableSortOrder({ value, table: config.rowsPerPageTable }));
|
setPage(0);
|
||||||
},
|
};
|
||||||
[config.rowsPerPageTable, dispatch]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Check for active filters
|
// Check for active filters
|
||||||
const hasActiveFilters = Boolean(
|
const hasActiveFilters = Boolean(
|
||||||
|
|||||||
Reference in new issue
Block a user