fix out of order & missing field rows being added twice to tableRowsLocalAtom

This commit is contained in:
Sidney Alcantara
2022-11-22 17:07:36 +11:00
parent 0b75d60813
commit 6a30220b94

View File

@@ -129,9 +129,9 @@ export const addRowAtom = atom(
});
}
// Also add to rowsLocal if any required fields are missing
// Also add to rowsLocal if any required fields are missing
// (not out of order since those cases are handled above)
if (missingRequiredFields.length > 0) {
else if (missingRequiredFields.length > 0) {
set(tableRowsLocalAtom, {
type: "add",
row: { ...rowValues, _rowy_outOfOrder: false },