Skip to content

Commit

Permalink
act based on PactIc and not senderAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
nil-amrutlal authored and MRVDH committed Nov 9, 2023
1 parent ce61864 commit 2e36857
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export const CompactTransfersTable = (
</Table.Head>
<Table.Body>
{transfers.edges.map((edge, index) => {
// This way we avoid repeated transfers
// These transfers are going to be added to their crosschain counterpart
if (!edge?.node.senderAccount) {
/** These transfers are going to be added to their crosschain counterpart and
this way we avoid repeated transfers in the table */
if (!chainId && edge?.node.transaction?.pactId) {
return <></>;
}

Expand Down
9 changes: 9 additions & 0 deletions packages/apps/graph-client/src/graphql/queries.graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ export const getAccount: DocumentNode = gql`
crossChainTransfer {
...CoreTransferFields
}
transaction {
pactId
}
}
}
}
Expand Down Expand Up @@ -140,6 +143,9 @@ export const getChainAccount: DocumentNode = gql`
crossChainTransfer {
...CoreTransferFields
}
transaction {
pactId
}
}
}
}
Expand Down Expand Up @@ -228,6 +234,9 @@ export const getTransfers: DocumentNode = gql`
crossChainTransfer {
...CoreTransferFields
}
transaction {
pactId
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ const AccountTransfers: React.FC = () => {
</Table.Head>
<Table.Body>
{data.transfers.edges.map((edge, index) => {
// This way we avoid repeated transfers
// These transfers are going to be added to their crosschain counterpart
if (!edge?.node.senderAccount) {
/** These transfers are going to be added to their crosschain counterpart and
this way we avoid repeated transfers in the table */
if (edge?.node.transaction?.pactId) {
return <></>;
}

Expand Down Expand Up @@ -149,7 +149,7 @@ const AccountTransfers: React.FC = () => {
>
{edge?.node.receiverAccount}
</Link>
) : edge.node.crossChainTransfer?.receiverAccount ? (
) : edge?.node.crossChainTransfer?.receiverAccount ? (
<Link
href={`${routes.ACCOUNT}/${router.query.module}/${edge?.node.crossChainTransfer.receiverAccount}`}
>
Expand Down

0 comments on commit 2e36857

Please sign in to comment.