From f2495d6c70e97d5c6744ca415dfdfafa72b47445 Mon Sep 17 00:00:00 2001 From: Jiexi Luan Date: Wed, 18 Sep 2024 09:38:24 -0700 Subject: [PATCH] Deal with code dupe --- .../connect-accounts-modal/connect-accounts-modal.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/components/multichain/connect-accounts-modal/connect-accounts-modal.tsx b/ui/components/multichain/connect-accounts-modal/connect-accounts-modal.tsx index 8b0157eee4eb..1263af76a762 100644 --- a/ui/components/multichain/connect-accounts-modal/connect-accounts-modal.tsx +++ b/ui/components/multichain/connect-accounts-modal/connect-accounts-modal.tsx @@ -39,6 +39,10 @@ export const ConnectAccountsModal = ({ setSelectedAccounts(newSelectedAccounts); }; + const deselectAll = () => { + setSelectedAccounts([]); + }; + const selectAll = () => { const newSelectedAccounts = accounts.map( (account: { address: string }) => account.address, @@ -46,10 +50,6 @@ export const ConnectAccountsModal = ({ setSelectedAccounts(newSelectedAccounts); }; - const deselectAll = () => { - setSelectedAccounts([]); - }; - const allAreSelected = () => { return accounts.length === selectedAccounts.length; }; @@ -60,6 +60,7 @@ export const ConnectAccountsModal = ({ } else if (selectedAccounts.length > 0 && !allAreSelected()) { isIndeterminate = true; } + return (