fix: delete first row in Array Sub Table

This commit is contained in:
Anish Roy
2023-05-02 14:36:17 +05:30
parent 0d9c56487f
commit 9f6bc117c5

View File

@@ -201,7 +201,7 @@ export function useFirestoreDocAsCollectionWithAtom<T = TableRow>(
useEffect(() => {
if (deleteDocAtom) {
setDeleteRowAtom(() => (_: string, options?: ArrayTableRowData) => {
if (!options || !options.index) return;
if (!options || options.index === undefined) return;
const updateFunction = deleteRow(options.index);
return setRows(updateFunction);
});