Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #410 #412

Merged
merged 5 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/management-system-v2/components/process-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ const ProcessManagementList: FC<ProcessManagementListProps> = ({
processActions={processActions}
tableProps={{
scroll: {
y: `${window?.innerHeight - 32 /* Footer */ - 64 /* Header */ - 82 /* Table-Search etc */ - 60 /* Table-head */ - 60 /* Table-Footer / Pagination */}px`,
y: `${window!.innerHeight - 32 /* Footer */ - 64 /* Header */ - 82 /* Table-Search etc */ - 60 /* Table-head */ - 60 /* Table-Footer / Pagination */}px`,
jjoderis marked this conversation as resolved.
Show resolved Hide resolved
},
pagination: { position: ['bottomCenter'], pageSize: 20 },
onRow: (item) => ({
Expand Down
6 changes: 3 additions & 3 deletions src/management-system-v2/lib/useColumnWidth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const useResizeableColumnWidth = (
const initialisedWithHydratedValues =
useRef(
false,
); /* Basically a switch to check whther the state was updated once with the saved values, once hydrated */
); /* Basically a switch to check whether the state was updated once with the saved values, once hydrated */
const convertedWidthsToNumbers = useRef(false); /* Similar switch */

const computeNewColumns = useCallback(() => {
Expand Down Expand Up @@ -58,13 +58,13 @@ export const useResizeableColumnWidth = (
initialisedWithHydratedValues.current = true;
// console.debug('Updated columns with hydrated values');
setResizeableColumns(newColumns);
}, [hydrated, computeNewColumns, initialisedWithHydratedValues.current]);
}, [hydrated, computeNewColumns]);

/* If the user selects different columns (i.e. columnsInPreferences change) update the state with new columns */
useEffect(() => {
if (!hydrated) return;

/* This should onl run if the length of the arrays is dfferent */
/* This should only run if the length of the arrays is dfferent */
if (columnsInPreferences.length === resizeableColumns.length) return;

const newColumns = computeNewColumns();
Expand Down