Skip to content

Commit

Permalink
Merge pull request #781 from autonomys/bug/downloadFullBoardOnAccount…
Browse files Browse the repository at this point in the history
…AndAccountRewardsDetailsFix

Fix full export for Acount extrinsics list and account rewards list
  • Loading branch information
marc-aurele-besner committed Jul 30, 2024
2 parents fec4bee + 9903e5e commit 0acc300
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
26 changes: 17 additions & 9 deletions explorer/src/components/Account/AccountExtrinsicList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ export const AccountExtrinsicList: FC<Props> = ({ accountId }) => {
[sorting],
)

const where = useMemo(
() => ({
...filters,
signer: {
id_eq: accountId,
},
}),
[accountId, filters],
)

const variables = useMemo(() => {
return {
first: pagination.pageSize,
Expand All @@ -67,14 +77,9 @@ export const AccountExtrinsicList: FC<Props> = ({ accountId }) => {
? (pagination.pageIndex * pagination.pageSize).toString()
: undefined,
orderBy,
where: {
...filters,
signer: {
id_eq: accountId,
},
},
where,
}
}, [accountId, filters, orderBy, pagination.pageIndex, pagination.pageSize])
}, [orderBy, pagination.pageIndex, pagination.pageSize, where])

const { setIsVisible } = useSquidQuery<
ExtrinsicsByAccountIdQuery,
Expand Down Expand Up @@ -107,8 +112,11 @@ export const AccountExtrinsicList: FC<Props> = ({ accountId }) => {

const fullDataDownloader = useCallback(
() =>
downloadFullData(apolloClient, QUERY_ACCOUNT_EXTRINSICS, 'extrinsicsConnection', { orderBy }),
[apolloClient, orderBy],
downloadFullData(apolloClient, QUERY_ACCOUNT_EXTRINSICS, 'extrinsicsConnection', {
orderBy,
where,
}),
[apolloClient, orderBy, where],
)

const extrinsicsConnection = useMemo(() => data && data.extrinsicsConnection, [data])
Expand Down
3 changes: 2 additions & 1 deletion explorer/src/components/Account/AccountRewardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ export const AccountRewardList: FC = () => {
() =>
downloadFullData(apolloClient, QUERY_REWARDS_LIST, 'rewardEventsConnection', {
sortBy,
accountId: accountId ?? '',
}),
[apolloClient, sortBy],
[accountId, apolloClient, sortBy],
)

useEffect(() => {
Expand Down

0 comments on commit 0acc300

Please sign in to comment.