Skip to content

Commit

Permalink
Merge pull request #25 from ccrsxx/fix/undefined-property-access-on-a…
Browse files Browse the repository at this point in the history
…rray-documents-hook
  • Loading branch information
ccrsxx authored Aug 4, 2023
2 parents f0e162e + 987adc0 commit 47f1780
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/hooks/useArrayDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export function useArrayDocument<T>(
cachedDocsId.map((id) => getDoc(doc(collection, id)))
);

const docs = docsSnapshot.map((doc) =>
doc.data({ serverTimestamps: 'estimate' })
);
const docs = docsSnapshot
.filter((doc) => doc.exists())
.map((doc) => doc.data({ serverTimestamps: 'estimate' }));

if (!docs.length) {
setData(null);
Expand Down

1 comment on commit 47f1780

@vercel
Copy link

@vercel vercel bot commented on 47f1780 Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

twitter-clone – ./

twitter-clone-ccrsxx.vercel.app
twitter-clone-git-main-ccrsxx.vercel.app
twitter-clone-chi-gold.vercel.app

Please sign in to comment.