Skip to content

Commit

Permalink
Fix wallet copy account address format
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitayutanov committed Jul 26, 2024
1 parent daa9251 commit cb012da
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { decodeAddress } from '@gear-js/api';
import { useAccount, useAlert } from '@gear-js/react-hooks';
import { Button, Modal, buttonStyles } from '@gear-js/ui';
import type { InjectedAccountWithMeta } from '@polkadot/extension-inject/types';
Expand Down Expand Up @@ -81,11 +80,6 @@ const AccountsModal = ({ close }: Props) => {
handleAccountClick(_account);
};

const handleCopy = () => {
const decodedAddress = decodeAddress(address);
copyToClipboard(decodedAddress, alert);
};

const accountBtnClasses = cx(
buttonStyles.large,
styles.accountButton,
Expand All @@ -95,7 +89,7 @@ const AccountsModal = ({ close }: Props) => {
return (
<li key={address} className={styles.accountItem}>
<AccountButton name={meta.name} address={address} className={accountBtnClasses} onClick={handleClick} />
<Button icon={CopyKeySVG} color="transparent" onClick={handleCopy} />
<Button icon={CopyKeySVG} color="transparent" onClick={() => copyToClipboard(address, alert)} />
</li>
);
});
Expand Down

0 comments on commit cb012da

Please sign in to comment.