diff --git a/app/src/utils/constants.ts b/app/src/utils/constants.ts index 9b030f77..c1e74a08 100644 --- a/app/src/utils/constants.ts +++ b/app/src/utils/constants.ts @@ -41,7 +41,7 @@ export const DefaultForageConfig: LocalForageConfig = { // this store should be used for any on-chain/off-chain data but never user data (as we might clear it without notice) name: 'dGrants', // we can bump this version number to bust the users cache - version: 1, + version: 3, }; // LocalForage keys diff --git a/app/src/utils/data/contributions.ts b/app/src/utils/data/contributions.ts index 6a1a00b3..20d7019b 100644 --- a/app/src/utils/data/contributions.ts +++ b/app/src/utils/data/contributions.ts @@ -56,7 +56,7 @@ export async function getContributions( const limit = 100; - const fetchUntilAll = async (SUBGRAPH_URL: string, before = [], skip = 0): Promise => { + const fetchUntilAll = async (SUBGRAPH_URL: string, before: any[] = [], skip = 0): Promise => { const res = await fetch(SUBGRAPH_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -80,7 +80,8 @@ export async function getContributions( const json = await res.json(); if (json.data.grantDonations.length) { - return await fetchUntilAll(SUBGRAPH_URL, before, skip + 1); + const current = [...before, ...json.data.grantDonation]; + return await fetchUntilAll(SUBGRAPH_URL, current, skip + 1); } else { return [...before]; }