From daa4dc750bc83cfc34240e767b35e28328ce8fba Mon Sep 17 00:00:00 2001 From: keyan Date: Wed, 18 May 2022 14:31:24 -0500 Subject: [PATCH] fix satistics profile photo issue --- fragments/wallet.js | 5 +++++ pages/satistics.js | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fragments/wallet.js b/fragments/wallet.js index bd6c7b41..bdf02e70 100644 --- a/fragments/wallet.js +++ b/fragments/wallet.js @@ -1,5 +1,6 @@ import { gql } from '@apollo/client' import { ITEM_FIELDS } from './items' +import { USER_FIELDS } from './users' export const INVOICE = gql` query Invoice($id: ID!) { @@ -27,8 +28,12 @@ export const WITHDRAWL = gql` export const WALLET_HISTORY = gql` ${ITEM_FIELDS} + ${USER_FIELDS} query WalletHistory($cursor: String, $inc: String) { + me { + ...UserFields + } walletHistory(cursor: $cursor, inc: $inc) { facts { id diff --git a/pages/satistics.js b/pages/satistics.js index fbe1c692..66f80dde 100644 --- a/pages/satistics.js +++ b/pages/satistics.js @@ -3,7 +3,6 @@ import Link from 'next/link' import { Table } from 'react-bootstrap' import { getGetServerSideProps } from '../api/ssrApollo' import Layout from '../components/layout' -import { useMe } from '../components/me' import MoreFooter from '../components/more-footer' import UserHeader from '../components/user-header' import { WALLET_HISTORY } from '../fragments/wallet' @@ -115,8 +114,7 @@ function Detail ({ fact }) { return
} -export default function Satistics ({ data: { walletHistory: { facts, cursor } } }) { - const me = useMe() +export default function Satistics ({ data: { me, walletHistory: { facts, cursor } } }) { const router = useRouter() const { data, fetchMore } = useQuery(WALLET_HISTORY, { variables: { inc: router.query.inc } }) @@ -150,7 +148,7 @@ export default function Satistics ({ data: { walletHistory: { facts, cursor } } } if (data) { - ({ walletHistory: { facts, cursor } } = data) + ({ me, walletHistory: { facts, cursor } } = data) } const SatisticsSkeleton = () => (