Skip to content

Commit

Permalink
Merge pull request #54 from Montelibero/fix-claim-claimable
Browse files Browse the repository at this point in the history
filter out claimClaimableBalance txs as well
  • Loading branch information
sozidatel authored Jun 3, 2024
2 parents fb098ac + efc8a7c commit c5f2361
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "org.montelibero.solar",
"displayName": "MTL Solar",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"description": "Wallet for the Stellar payment network by Montelibero.",
"license": "MIT",
"private": true,
Expand Down
11 changes: 8 additions & 3 deletions src/Account/components/AccountTransactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import { InteractiveSignatureRequestList } from "./SignatureRequestList"
import TransactionList from "./TransactionList"
import { isDustTransaction } from "~Generic/lib/transaction"

const excludeClaimableFilter = (tx: DecodedTransactionResponse) =>
!tx.decodedTx.operations.every(o => o.type === "createClaimableBalance")
const excludeClaimableFilter = (account: Account, tx: DecodedTransactionResponse) =>
!tx.decodedTx.operations.every(
o => o.type === "createClaimableBalance" || (o.type === "claimClaimableBalance" && o.source !== account.publicKey)
)

const excludeDustFilter = (account: Account, tx: DecodedTransactionResponse) =>
!isDustTransaction(tx.decodedTx, account)
Expand Down Expand Up @@ -82,7 +84,10 @@ function AccountTransactions(props: { account: Account }) {
const txsFilter = React.useCallback(
(txs: DecodedTransactionResponse[]) =>
txs.filter(tx => {
return (showClaimableBalanceTxs || excludeClaimableFilter(tx)) && (showDust || excludeDustFilter(account, tx))
return (
(showClaimableBalanceTxs || excludeClaimableFilter(account, tx)) &&
(showDust || excludeDustFilter(account, tx))
)
}),
[]
)
Expand Down

0 comments on commit c5f2361

Please sign in to comment.