Skip to content

Commit

Permalink
Fix: Merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
LevBeta authored and chambaz committed Nov 27, 2024
1 parent 02daf7c commit 4e1c451
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions packages/marginfi-v2-ui-state/src/lib/points.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,8 @@ async function fetchLeaderboardData(connection: Connection, settings: Leaderboar
}

const pointsQuery = query(
<<<<<<< Updated upstream
collection(firebaseApi.db, "migrated_points"),
=======
collection(firebaseApi.db, POINTS_DOCUMENT),
>>>>>>> Stashed changes
...(settings.search
? searchQ
: [
Expand Down Expand Up @@ -152,11 +149,8 @@ async function fetchLeaderboardData(connection: Connection, settings: Leaderboar
}

async function fetchTotalLeaderboardCount() {
<<<<<<< Updated upstream
const q = query(collection(firebaseApi.db, "migrated_points"), where("total_points", ">=", 1));
=======
const q = query(collection(firebaseApi.db, POINTS_DOCUMENT), where("total_points", ">=", 1));
>>>>>>> Stashed changes
const qCount = await getCountFromServer(q);
const count = qCount.data().count;
return count;
Expand Down Expand Up @@ -224,11 +218,7 @@ async function fetchLeaderboardDataOld({
// Firebase query is very constrained, so we calculate the number of users with more points
// as the the count of users with more points inclusive of corrupted rows - the count of corrupted rows
async function fetchUserRank(address: string): Promise<number> {
<<<<<<< Updated upstream
const q = query(collection(firebaseApi.db, "migrated_points"), where("owner", "==", address));
=======
const q = query(collection(firebaseApi.db, POINTS_DOCUMENT), where("owner", "==", address));
>>>>>>> Stashed changes

const data = await getDocs(q);

Expand All @@ -240,13 +230,9 @@ async function fetchUserRank(address: string): Promise<number> {
}

async function fetchTotalUserCount() {
<<<<<<< Updated upstream
const q1 = query(collection(firebaseApi.db, "migrated_points"));
const q2 = query(collection(firebaseApi.db, "migrated_points"), where("owner", "==", null));
=======
const q1 = query(collection(firebaseApi.db, POINTS_DOCUMENT));
const q2 = query(collection(firebaseApi.db, POINTS_DOCUMENT), where("owner", "==", null));
>>>>>>> Stashed changes
const q1Count = await getCountFromServer(q1);
const q2Count = await getCountFromServer(q2);
return q1Count.data().count - q2Count.data().count;
Expand Down Expand Up @@ -277,11 +263,7 @@ const DEFAULT_USER_POINTS_DATA: UserPointsData = {
const getPointsDataForUser = async (wallet: string | undefined): Promise<UserPointsData> => {
if (!wallet) return DEFAULT_USER_POINTS_DATA;

<<<<<<< Updated upstream
const userPointsDoc = doc(firebaseApi.db, "migrated_points", wallet);
=======
const userPointsDoc = doc(firebaseApi.db, POINTS_DOCUMENT, wallet);
>>>>>>> Stashed changes
const userPublicProfileDoc = doc(firebaseApi.db, "users_public", wallet);

let userPointsSnap;
Expand Down

0 comments on commit 4e1c451

Please sign in to comment.