From f707093107165f93b88fccc505010db70cb8379f Mon Sep 17 00:00:00 2001 From: chambaz Date: Tue, 3 Dec 2024 14:47:12 -0500 Subject: [PATCH 1/2] Revert "chore: update fb doc" This reverts commit 6ac266caad6410d22d430dd73b7851c7c4d067f2. --- packages/marginfi-v2-ui-state/src/lib/points.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/marginfi-v2-ui-state/src/lib/points.ts b/packages/marginfi-v2-ui-state/src/lib/points.ts index 753964da13..6268d2ad89 100644 --- a/packages/marginfi-v2-ui-state/src/lib/points.ts +++ b/packages/marginfi-v2-ui-state/src/lib/points.ts @@ -57,7 +57,7 @@ let lastOrderDir: "desc" | "asc" | undefined; let prevPages: LeaderboardRow[][] = []; let lastSearch: string | undefined; -const POINTS_DOCUMENT: string = "points"; +const POINTS_DOCUMENT: string = "migrated_points"; async function fetchLeaderboardData(connection: Connection, settings: LeaderboardSettings): Promise { if (settings.pageDirection === "prev" && settings.currentPage > 1) { @@ -96,7 +96,7 @@ async function fetchLeaderboardData(connection: Connection, settings: Leaderboar const pointsQuery = query( collection(firebaseApi.db, POINTS_DOCUMENT), - + ...(settings.search ? searchQ : [ @@ -150,7 +150,7 @@ async function fetchLeaderboardData(connection: Connection, settings: Leaderboar async function fetchTotalLeaderboardCount() { const q = query(collection(firebaseApi.db, POINTS_DOCUMENT), where("total_points", ">=", 1)); - + const qCount = await getCountFromServer(q); const count = qCount.data().count; return count; @@ -232,7 +232,7 @@ async function fetchUserRank(address: string): Promise { async function fetchTotalUserCount() { const q1 = query(collection(firebaseApi.db, POINTS_DOCUMENT)); const q2 = query(collection(firebaseApi.db, POINTS_DOCUMENT), where("owner", "==", null)); - + const q1Count = await getCountFromServer(q1); const q2Count = await getCountFromServer(q2); return q1Count.data().count - q2Count.data().count; From 259fbe6f91549565686261d573d5ef3f9b4ad6e0 Mon Sep 17 00:00:00 2001 From: chambaz Date: Tue, 3 Dec 2024 14:50:06 -0500 Subject: [PATCH 2/2] chore: remove log --- packages/marginfi-v2-ui-state/src/lib/points.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/marginfi-v2-ui-state/src/lib/points.ts b/packages/marginfi-v2-ui-state/src/lib/points.ts index 6268d2ad89..03f03e3793 100644 --- a/packages/marginfi-v2-ui-state/src/lib/points.ts +++ b/packages/marginfi-v2-ui-state/src/lib/points.ts @@ -74,8 +74,6 @@ async function fetchLeaderboardData(connection: Connection, settings: Leaderboar return rtn; } - console.log(settings); - if ( lastOrderCol !== settings.orderCol || (lastOrderDir !== settings.orderDir && settings.pageDirection !== "prev") || @@ -96,7 +94,7 @@ async function fetchLeaderboardData(connection: Connection, settings: Leaderboar const pointsQuery = query( collection(firebaseApi.db, POINTS_DOCUMENT), - + ...(settings.search ? searchQ : [ @@ -150,7 +148,7 @@ async function fetchLeaderboardData(connection: Connection, settings: Leaderboar async function fetchTotalLeaderboardCount() { const q = query(collection(firebaseApi.db, POINTS_DOCUMENT), where("total_points", ">=", 1)); - + const qCount = await getCountFromServer(q); const count = qCount.data().count; return count; @@ -232,7 +230,7 @@ async function fetchUserRank(address: string): Promise { async function fetchTotalUserCount() { const q1 = query(collection(firebaseApi.db, POINTS_DOCUMENT)); const q2 = query(collection(firebaseApi.db, POINTS_DOCUMENT), where("owner", "==", null)); - + const q1Count = await getCountFromServer(q1); const q2Count = await getCountFromServer(q2); return q1Count.data().count - q2Count.data().count;