From 029600f0ad042dd9b2ce9387961ed78a5947e186 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 2 Nov 2024 09:59:08 -0300 Subject: [PATCH] fix: subgraph's claimer.currentRequest persists after being transferred workaround to be removed after subgraph's update --- src/data/user.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/data/user.ts b/src/data/user.ts index 1072dc6..2a8f742 100644 --- a/src/data/user.ts +++ b/src/data/user.ts @@ -7,8 +7,13 @@ import { MeQuery } from "generated/graphql"; // function should be removed const sanitize = (res: MeQuery[]) => { res.map((claimer) => { - if (claimer.claimer?.currentRequest && claimer.claimer?.registration) - claimer.claimer.registration = null; + if (claimer.claimer?.currentRequest && claimer.claimer?.registration) { + if (claimer.claimer?.currentRequest.index <= -100) { + claimer.claimer.currentRequest = null; + } else { + claimer.claimer.registration = null; + } + } }); }; @@ -16,7 +21,6 @@ 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(