Skip to content

Commit

Permalink
Merge pull request #1921 from galacticcouncil/disable-atoken-transfer
Browse files Browse the repository at this point in the history
Disable atoken transfer
  • Loading branch information
vkulinich-cl authored Dec 3, 2024
2 parents 6605273 + 93f8a2e commit e20229a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const WalletAssetsTableActions = (props: Props) => {
icon: <PlusIcon />,
label: t("wallet.assets.table.actions.deposit"),
onSelect: () => navigate({ to: LINKS.cross_chain }),
disabled: account?.isExternalWalletConnected,
disabled: account?.isExternalWalletConnected || props.asset.meta.isErc20,
},
]

Expand Down Expand Up @@ -176,8 +176,10 @@ export const WalletAssetsTableActions = (props: Props) => {
account?.isExternalWalletConnected
? []
: [
...buttons.filter((button) =>
hiddenElementsKeys.includes(button.key),
...buttons.filter(
(button) =>
hiddenElementsKeys.includes(button.key) &&
!button.disabled,
),
...actionItems,
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ export const WalletAssetsTableActionsMob = ({
<Button
sx={{ width: "100%" }}
size="small"
disabled={account?.isExternalWalletConnected}
disabled={
account?.isExternalWalletConnected || row.meta.isErc20
}
>
<PlusIcon />
{t("wallet.assets.table.actions.deposit")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ export function WalletTransferSectionOnchain({
return await createTransaction(
{
tx:
asset.toString() === native.id
asset.toString() === native.id || assetMeta.isErc20
? api.tx.currencies.transfer(
normalizedDest,
native.id,
asset.toString(),
amount.toFixed(),
)
: api.tx.tokens.transfer(normalizedDest, asset, amount.toFixed()),
Expand Down

0 comments on commit e20229a

Please sign in to comment.