Skip to content

Commit

Permalink
Merge branch 'main' of github.com:clidey/whodb into release
Browse files Browse the repository at this point in the history
  • Loading branch information
hkdeman committed Aug 19, 2024
2 parents 991add8 + ebb637c commit 972678c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/components/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ const TData: FC<ITDataProps> = ({ cell, onCellUpdate, checked, onRowCheck, disab
}, [changed, handleCancel, escapeAttempted]);

const language = useMemo(() => {
if (editedData == null) {
return;
}
if (isValidJSON(editedData)) {
return "json";
}
Expand Down Expand Up @@ -521,13 +524,13 @@ export const Table: FC<ITableProps> = ({ className, columns: actualColumns, rows
if (onRowUpdate == null) {
return Promise.resolve();
}
delete row["#"];
return onRowUpdate(row).then(() => {
setData(value => {
const newValue = clone(value);
newValue[index] = clone(row);
return newValue;
});
delete row["#"];
});
}, [onRowUpdate]);

Expand Down

0 comments on commit 972678c

Please sign in to comment.