From cb1135bcbe79e8adc466cc190849b8e6e796d8be Mon Sep 17 00:00:00 2001 From: harshbaz <106158714+harshbaz@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:13:49 +0530 Subject: [PATCH] FEtch more videos (#2017) USe start at --- packages/experiments/src/lib/helpers/feed.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/experiments/src/lib/helpers/feed.ts b/packages/experiments/src/lib/helpers/feed.ts index 38e50eaaf..dbc384b55 100644 --- a/packages/experiments/src/lib/helpers/feed.ts +++ b/packages/experiments/src/lib/helpers/feed.ts @@ -5,8 +5,8 @@ import { limit, orderBy, Query, - startAt, DocumentReference, + startAfter, } from 'firebase/firestore' import type { CollectionName, UpDownPost } from '../db/db.types' import { getDb } from '$lib/db' @@ -20,14 +20,14 @@ export async function getVideos(_lastRef?: DocumentReference) { q = query( collection(db, 'ud-videos' as CollectionName), orderBy('created_at', 'desc'), - limit(5), - startAt(_lastRef), + limit(50), + startAfter(_lastRef), ) } else { q = query( collection(db, 'ud-videos' as CollectionName), orderBy('created_at', 'desc'), - limit(5), + limit(50), ) } const snapshot = await getDocs(q)