Fixed pages rerendering on sidebar state change

This commit is contained in:
Daniel Cojocea committed 2024-08-29 02:19:19 -04:00
1 parent aca350495a
commit 111501156f
4 files changed
+7 -5

No files matched your search

+4 -1
View File
@@ -20,7 +20,10 @@ const uiSlice = createSlice({
initialState,
reducers: {
setRowsPerPage: (state, action) => {
state[action.payload.table].rowsPerPage = action.payload.value;
const { table, value } = action.payload;
if (state[table]) {
state[table].rowsPerPage = value;
}
},
toggleSidebar: (state) => {
state.sidebar.collapsed = !state.sidebar.collapsed;