mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 08:18:51 -06:00
web: Handle error during table data update
This commit is contained in:
@@ -437,7 +437,15 @@ const DataTable = (props: DataTableProps) => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
if (updatedRows.length > 0) {
|
if (updatedRows.length > 0) {
|
||||||
tableRef.current.updateData(updatedRows).then(() => {});
|
tableRef.current
|
||||||
|
.updateData(updatedRows)
|
||||||
|
.then(() => {})
|
||||||
|
.catch((e) => {
|
||||||
|
// WORKAROUND: Updating the same row twice triggers an exception.
|
||||||
|
// In that case, we just update the whole table.
|
||||||
|
console.log(e);
|
||||||
|
tableRef.current!!.replaceData(newTableData).then(() => {});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tableRef.current.replaceData(newTableData).then(() => {});
|
tableRef.current.replaceData(newTableData).then(() => {});
|
||||||
|
|||||||
Reference in New Issue
Block a user