Skip to content

Commit

Permalink
Merge pull request #784 from autonomys/main
Browse files Browse the repository at this point in the history
Sync Production with main
  • Loading branch information
marc-aurele-besner authored Jul 31, 2024
2 parents b7a340a + 0810d96 commit 2a323dc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 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
2 changes: 1 addition & 1 deletion explorer/src/components/Staking/OperatorsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export const OperatorsList: FC = () => {
}, [])

const operatorsConnection = useMemo(() => {
if (useRpcData && subspaceAccount) {
if (useRpcData) {
const myRpcNominatorIds = deposits
.filter((d) => d.account === subspaceAccount)
.map((n) => n.operatorId.toString())
Expand Down
1 change: 0 additions & 1 deletion explorer/src/providers/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ export const WalletProvider: FC<Props> = ({ children }) => {
}, [actingAccount])

useEffect(() => {
if (!injector) return
setup()
}, [injector, setup])

Expand Down
2 changes: 1 addition & 1 deletion explorer/src/utils/table.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const countTablePages = (totalCount: number, pageSize: number) =>
Math.max(1, Math.floor(totalCount / pageSize))
Math.max(1, Math.floor(totalCount / pageSize)) + (totalCount % pageSize > 0 ? 1 : 0)

0 comments on commit 2a323dc

Please sign in to comment.