From c29ce01671e05f31ba2feb3d552ee72267c1bae9 Mon Sep 17 00:00:00 2001 From: Bhargav Vivek Modak Date: Tue, 9 Apr 2024 16:48:58 +0530 Subject: [PATCH] fix: Correctly check for workspace existence --- client/src/components/workspace/SideStrip.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/src/components/workspace/SideStrip.js b/client/src/components/workspace/SideStrip.js index 5fd92d6..09c1cea 100644 --- a/client/src/components/workspace/SideStrip.js +++ b/client/src/components/workspace/SideStrip.js @@ -96,9 +96,7 @@ export default function SideStrip({ handleSelect, selected }) { }; const dbRef = doc(db, 'workspace', params.workspaceId); - // Create doc if it doesn't exist, else update it - const docSnap = await dbRef.get(); - if (!docSnap.exists()) { + if (!dbRef.exists()) { await setDoc(dbRef, data); } else { await updateDoc(dbRef, data);