Skip to content

Commit

Permalink
fix: registration issue at legacy subgraph
Browse files Browse the repository at this point in the history
This fix must be temporary. Once the legacy subgraph is fixed and redeployed, sanitize function in user.ts must be removed
  • Loading branch information
martillansky committed Oct 24, 2024
1 parent 5385d20 commit 42edc65
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/data/user.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import { supportedChains } from "config/chains";
import { sdk } from "config/subgraph";
import { MeQuery } from "generated/graphql";

// This fixes an error in the legacy subgraph were registration has not
// been removed as expected. Once solved the issue at subgraph level this
// function should be removed
const sanitize = (res: MeQuery[]) => {
res.map((claimer) => {
if (claimer.claimer?.currentRequest && claimer.claimer?.registration)
claimer.claimer.registration = null;
});
};

export const getMyData = async (account: string) => {
const res = await Promise.all(
supportedChains.map((chain) => sdk[chain.id].Me({ id: account })),
);

sanitize(res);

const homeChain = supportedChains.find(
(_, i) => res[i].claimer?.registration,
);
Expand Down

0 comments on commit 42edc65

Please sign in to comment.