mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
fix rows with missing fields listed as out of order when IDs are set to decrement
This commit is contained in:
@@ -116,6 +116,7 @@ export const addRowAtom = atom(
|
||||
|
||||
// Add to rowsLocal (i.e. display on top, out of order) if:
|
||||
// - any required fields are missing
|
||||
// (**not out of order if IDs are not decrementing**)
|
||||
// - deliberately out of order
|
||||
// - there are filters set and we couldn’t set the value of a field to
|
||||
// fit in the filtered query
|
||||
@@ -128,7 +129,13 @@ export const addRowAtom = atom(
|
||||
) {
|
||||
set(tableRowsLocalAtom, {
|
||||
type: "add",
|
||||
row: { ...rowValues, _rowy_outOfOrder: true },
|
||||
row: {
|
||||
...rowValues,
|
||||
_rowy_outOfOrder:
|
||||
row._rowy_outOfOrder === true ||
|
||||
outOfOrderFilters.size > 0 ||
|
||||
setId !== "decrement",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user