Increase default fetch size 25 -> 99

This commit is contained in:
Austin Chen 2021-12-20 09:56:27 -08:00
parent 5cbbb55dba
commit f79d69cd69

View File

@ -105,7 +105,7 @@ export async function listContracts(creatorId: string): Promise<Contract[]> {
}
export async function listAllContracts(): Promise<Contract[]> {
const q = query(contractCollection, orderBy('createdTime', 'desc'), limit(25))
const q = query(contractCollection, orderBy('createdTime', 'desc'), limit(99))
const snapshot = await getDocs(q)
return snapshot.docs.map((doc) => doc.data() as Contract)
}
@ -113,7 +113,7 @@ export async function listAllContracts(): Promise<Contract[]> {
export function listenForContracts(
setContracts: (contracts: Contract[]) => void
) {
const q = query(contractCollection, orderBy('createdTime', 'desc'), limit(25))
const q = query(contractCollection, orderBy('createdTime', 'desc'), limit(99))
return onSnapshot(q, (snap) => {
setContracts(snap.docs.map((doc) => doc.data() as Contract))
})