From 9f6bc117c5a7a4c3c2562024679081e13e878d2a Mon Sep 17 00:00:00 2001 From: Anish Roy <6275anishroy@gmail.com> Date: Tue, 2 May 2023 14:36:17 +0530 Subject: [PATCH] fix: delete first row in Array Sub Table --- src/hooks/useFirestoreDocAsCollectionWithAtom.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useFirestoreDocAsCollectionWithAtom.ts b/src/hooks/useFirestoreDocAsCollectionWithAtom.ts index 1d0499a0..1c69022d 100644 --- a/src/hooks/useFirestoreDocAsCollectionWithAtom.ts +++ b/src/hooks/useFirestoreDocAsCollectionWithAtom.ts @@ -201,7 +201,7 @@ export function useFirestoreDocAsCollectionWithAtom( 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); });