Skip to content

Commit

Permalink
Fix fetching user profiles
Browse files Browse the repository at this point in the history
- remove eruda and console logs
  • Loading branch information
samchuk-vlad committed Jun 11, 2024
1 parent f43523b commit 03f0d78
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
5 changes: 0 additions & 5 deletions src/modules/telegram/StatsPage/LeaderboardTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ function createObserver(
const LeaderboardTable = ({ period }: LeaderboardTableProps) => {
const myAddress = useMyMainAddress()

console.log('My main address', myAddress)
const { data: leaderboardDataResult, isLoading } =
leaderboardDataQueryByPeriod[period].useQuery(period)

Expand Down Expand Up @@ -124,8 +123,6 @@ const LeaderboardTable = ({ period }: LeaderboardTableProps) => {
[address, rank, reward]
)

console.log('CurrentUserRank', currentUserRank)

const dataItems = useMemo(
() => (leaderboardDataResult as any[]) || [],
[leaderboardDataResult]
Expand Down Expand Up @@ -190,8 +187,6 @@ const LeaderboardTable = ({ period }: LeaderboardTableProps) => {
].filter(Boolean)
}, [currentUserRank, dataItems, isElementIntersecting, initIsIntersection])

console.log('Leaderboard data', data)

return (
<>
{data.length === 0 &&
Expand Down
4 changes: 0 additions & 4 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ export type AppCommonProps = {
}

export default function App(props: AppProps<AppCommonProps>) {
useEffect(() => {
import('eruda').then((eruda) => eruda.default.init())
})

return (
<SessionProvider
basePath={
Expand Down
13 changes: 9 additions & 4 deletions src/services/datahub/profiles/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ export type SubsocialProfile = {
}

const GET_PROFILES = gql`
query GetProfiles($addresses: [String!]) {
spaces(args: { filter: { asProfileForAccounts: $addresses } }) {
query GetProfiles($addresses: [String!], $pageSize: Int!) {
spaces(
args: {
filter: { asProfileForAccounts: $addresses }
pageSize: $pageSize
}
) {
data {
id
name
Expand All @@ -32,10 +37,10 @@ export async function getProfiles(
if (addresses.length === 0) return []
const res = await datahubQueryRequest<
GetProfilesQuery,
GetProfilesQueryVariables
GetProfilesQueryVariables & { pageSize: number }
>({
document: GET_PROFILES,
variables: { addresses },
variables: { addresses, pageSize: addresses.length },
})
return res.spaces.data.map((space) => ({
isUpdated: space.updatedAtTime !== space.createdAtTime,
Expand Down
1 change: 0 additions & 1 deletion src/stores/my-account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ async function validateParentProxyAddress({
try {
// Remove proxy with type 'Any'
const currentProxy = await getParentProxyAddress(grillAddress)
// console.log(grillAddress, currentProxy)
if (!currentProxy || currentProxy !== parentProxyAddress) {
onInvalidProxy()
}
Expand Down

0 comments on commit 03f0d78

Please sign in to comment.