Skip to content

Commit

Permalink
FEtch more videos (#2017)
Browse files Browse the repository at this point in the history
USe start at
  • Loading branch information
harsh-mn-yral authored Nov 16, 2023
1 parent 56d7504 commit cb1135b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/experiments/src/lib/helpers/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)
Expand Down

0 comments on commit cb1135b

Please sign in to comment.