Skip to content

Commit

Permalink
fix: can remove last address in seed phrase management (#1451)
Browse files Browse the repository at this point in the history
* fix: can remove last address in seed phrase management

* Update src/ui/views/HDManager/AccountList.tsx

Co-authored-by: DMY <[email protected]>

---------

Co-authored-by: DMY <[email protected]>
  • Loading branch information
vvvvvv1vvvvvv and dmy147 authored Jun 13, 2023
1 parent 9e2e613 commit c73c631
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/ui/views/HDManager/AccountList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,9 @@ export const AccountList: React.FC<Props> = ({
content: 'The address is added to Rabby',
});
} else {
if (
currentAccountsRef.current.length <= 1 &&
keyring === KEYRING_CLASS.MNEMONIC
) {
message.error({
content:
'The last address cannot be deleted from the current page. Please go to Address Management to delete it',
duration: 5,
});
return;
}
await createTask(() => wallet.removeAddress(account.address, keyring));
await createTask(() =>
wallet.removeAddress(account.address, keyring, undefined, keyring !== KEYRING_CLASS.MNEMONIC)
);
removeCurrentAccount(account.address);
message.success({
content: 'The address is removed from Rabby',
Expand Down

0 comments on commit c73c631

Please sign in to comment.