From ad42b74841ebebec13941c9799018f6305cae981 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Thu, 15 Feb 2024 17:50:22 +0530 Subject: [PATCH] Integrate functions --- components/Accounts.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/components/Accounts.tsx b/components/Accounts.tsx index d5cb2e8..31b7339 100644 --- a/components/Accounts.tsx +++ b/components/Accounts.tsx @@ -21,19 +21,14 @@ const Accounts: React.FC = ({ const [expanded, setExpanded] = useState(false); const [isAccountCreating, setIsAccountCreating] = useState(false); - const handlePress = () => setExpanded(!expanded); const addAccountHandler = async () => { setIsAccountCreating(true); const newAccount = await addAccount(network); setIsAccountCreating(false); - setExpanded(false); - - if (newAccount) { - updateAccounts(newAccount); - updateIndex(selectedAccounts[selectedAccounts.length - 1].id + 1); - } + newAccount && updateAccounts(newAccount); + updateIndex(selectedAccounts[selectedAccounts.length - 1].id + 1); }; const selectedAccounts: Account[] = (() => {