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

Commit 6d1e94a

Browse files
committed
cleaning
1 parent 51a8774 commit 6d1e94a

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

src/components/HeaderMenu.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import header_action_button_section from "components/headerActions/HeaderActionB
99
import { HeaderActionResponse } from "cdm/HeaderActionModel";
1010
import header_action_types_section from "components/headerActions/HeaderActiontypesSection";
1111
import { TableColumn, TableDataType } from "cdm/FolderModel";
12+
import { Column } from "@tanstack/react-table";
1213

1314
const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
1415
const { table, header, column } = headerMenuProps.headerProps;
@@ -49,11 +50,6 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
4950
}
5051
}, [created]);
5152

52-
useEffect(() => {
53-
// Throw event if label is changed
54-
setLabelState(labelState);
55-
}, [labelState]);
56-
5753
/**
5854
* Array of action buttons asociated to the header
5955
*/
@@ -108,15 +104,15 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
108104
const futureOrder = table
109105
.getAllColumns()
110106
.map((o: any) => (o.id === column.id ? newKey : o.id));
107+
table.setColumnOrder(futureOrder);
108+
setkeyState(newKey);
111109
dispatch({
112110
type: ActionTypes.UPDATE_COLUMN_LABEL,
113111
columnId: column.id,
114112
accessorKey: newKey,
115113
newKey: newKey,
116114
label: labelState,
117115
});
118-
setkeyState(newKey);
119-
table.setColumnOrder(futureOrder);
120116
}
121117
function handleKeyDown(e: any) {
122118
if (e.key === "Enter") {

src/components/Table.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ export function Table(tableData: TableDataType) {
270270
});
271271
setRowTemplateState(settingsValue);
272272
}
273-
274273
LOGGER.debug(`<= Table`);
275274
return (
276275
<>

src/components/reducers/DatabaseDispatch.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,9 @@ export function databaseReducer(state: TableDataType, action: any) {
148148
action.newKey,
149149
state,
150150
UpdateRowOptions.COLUMN_KEY
151-
).catch((err) => {
152-
throw err;
153-
});
151+
);
154152
})
155-
).catch((err) => {
156-
throw err;
157-
});
158-
153+
);
159154
return update(state, {
160155
skipReset: { $set: true },
161156
// Modify column visually with the new label

0 commit comments

Comments
 (0)