From bbe5e86205d95b2ebb0f1ce1a03aea5898a437ac Mon Sep 17 00:00:00 2001 From: Vibhu Tomer Date: Tue, 12 May 2026 15:32:54 +0000 Subject: [PATCH] fix(firestore): prevent double database write on file rename upload --- Govt-Billing-React/src/firebase/firestore.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Govt-Billing-React/src/firebase/firestore.ts b/Govt-Billing-React/src/firebase/firestore.ts index bf8cd1b..a2d0499 100644 --- a/Govt-Billing-React/src/firebase/firestore.ts +++ b/Govt-Billing-React/src/firebase/firestore.ts @@ -48,6 +48,8 @@ const uploadFileToCloud = async ( ...fileData, owner: user.uid, }); + if (onSuccess) onSuccess(); + return; } await setDoc(doc(db, "invoices", `${user.uid}-${fileData.name}`), { ...fileData,