Skip to content

Commit

Permalink
Deal with code dupe
Browse files Browse the repository at this point in the history
  • Loading branch information
jiexi committed Sep 18, 2024
1 parent 9f55140 commit f2495d6
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ export const ConnectAccountsModal = ({
setSelectedAccounts(newSelectedAccounts);
};

const deselectAll = () => {
setSelectedAccounts([]);
};

const selectAll = () => {
const newSelectedAccounts = accounts.map(
(account: { address: string }) => account.address,
);
setSelectedAccounts(newSelectedAccounts);
};

const deselectAll = () => {
setSelectedAccounts([]);
};

const allAreSelected = () => {
return accounts.length === selectedAccounts.length;
};
Expand All @@ -60,6 +60,7 @@ export const ConnectAccountsModal = ({
} else if (selectedAccounts.length > 0 && !allAreSelected()) {
isIndeterminate = true;
}

return (
<ConnectAccountsModalList
accounts={accounts}
Expand Down

0 comments on commit f2495d6

Please sign in to comment.