fix table sort does not work if table has formula column

This commit is contained in:
Bobby Wang
2024-01-23 07:28:48 +08:00
parent 0981ae026b
commit d49cb2786f
2 changed files with 1 additions and 13 deletions

View File

@@ -386,9 +386,7 @@ export const updateFieldAtom = atom(
);
if (!row) throw new Error("Could not find row");
const isLocalRow =
fieldName.startsWith("_rowy_formulaValue_") ||
Boolean(find(tableRowsLocal, ["_rowy_ref.path", path]));
const isLocalRow = Boolean(find(tableRowsLocal, ["_rowy_ref.path", path]));
const update: Partial<TableRow> = {};
@@ -469,14 +467,6 @@ export const updateFieldAtom = atom(
deleteFields: deleteField ? [fieldName] : [],
});
// TODO(han): Formula field persistence
// const config = find(tableColumnsOrdered, (c) => {
// const [, key] = fieldName.split("_rowy_formulaValue_");
// return c.key === key;
// });
// if(!config.persist) return;
if (fieldName.startsWith("_rowy_formulaValue")) return;
// If it has no missingRequiredFields, also write to db
// And write entire row to handle the case where it doesnt exist in db yet
if (missingRequiredFields.length === 0) {

View File

@@ -6,9 +6,7 @@ import {
_deleteRowDbAtom,
_updateRowDbAtom,
tableNextPageAtom,
tableRowsAtom,
tableRowsDbAtom,
tableRowsLocalAtom,
tableScope,
tableSettingsAtom,
} from "@src/atoms/tableScope";