Skip to content

Commit

Permalink
Merge branch 'epic-base' of https://github.com/dappforce/grillchat in…
Browse files Browse the repository at this point in the history
…to epic-base
  • Loading branch information
teodorus-nathaniel committed Jun 11, 2024
2 parents f474402 + eb0d528 commit 5de225d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
4 changes: 1 addition & 3 deletions src/components/AddressAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ const AddressAvatar = forwardRef<HTMLDivElement, AddressAvatarProps>(
const [isAvatarError, setIsAvatarError] = useState(false)
const onImageError = useCallback(() => setIsAvatarError(true), [])

const { data: profile, isLoading } = getProfileQuery.useQuery(address, {
refetchOnMount: 'always',
})
const { data: profile, isLoading } = getProfileQuery.useQuery(address)

const profileSource = profile?.profileSpace?.content?.profileSource
const subsocialProfileImage = profile?.profileSpace?.content?.image
Expand Down
2 changes: 1 addition & 1 deletion src/components/Name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ LinkOrText.displayName = 'LinkOrText'

export function useName(address: string) {
const { data: profile, isLoading: isLoadingProfile } =
getProfileQuery.useQuery(address, { refetchOnMount: 'always' })
getProfileQuery.useQuery(address)
const textColor = useRandomColor(address)

let name = generateRandomName(address)
Expand Down
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 5de225d

Please sign in to comment.