diff --git a/context/QuestsProvider.tsx b/context/QuestsProvider.tsx index 194b4af3..e1e10867 100644 --- a/context/QuestsProvider.tsx +++ b/context/QuestsProvider.tsx @@ -98,11 +98,13 @@ export const QuestsContextProvider = ({ }, []); useMemo(() => { - getTrendingQuests().then((data: QuestDocument[] | QueryError) => { - if ((data as QueryError).error) return; - setTrendingQuests(data as QuestDocument[]); - }); - }, []); + getTrendingQuests(hexToDecimal(address)).then( + (data: QuestDocument[] | QueryError) => { + if ((data as QueryError).error) return; + setTrendingQuests(data as QuestDocument[]); + } + ); + }, [address]); useMemo(() => { if (!address) return; diff --git a/services/apiService.ts b/services/apiService.ts index 7eb30821..dba45eca 100644 --- a/services/apiService.ts +++ b/services/apiService.ts @@ -120,9 +120,11 @@ export const getQuests = async () => { } }; -export const getTrendingQuests = async () => { +export const getTrendingQuests = async (addr = "") => { try { - const response = await fetch(`${baseurl}/get_trending_quests`); + const response = await fetch( + `${baseurl}/get_trending_quests${addr ? `?addr=${addr}` : ""}` + ); return await response.json(); } catch (err) { console.log("Error while fetching trending quests", err);