forked from cerc-io/laconic-wallet
Integrate functions
This commit is contained in:
parent
5df584b750
commit
ad42b74841
@ -21,19 +21,14 @@ const Accounts: React.FC<AccountsProps> = ({
|
|||||||
|
|
||||||
const [expanded, setExpanded] = useState(false);
|
const [expanded, setExpanded] = useState(false);
|
||||||
const [isAccountCreating, setIsAccountCreating] = useState(false);
|
const [isAccountCreating, setIsAccountCreating] = useState(false);
|
||||||
|
|
||||||
const handlePress = () => setExpanded(!expanded);
|
const handlePress = () => setExpanded(!expanded);
|
||||||
|
|
||||||
const addAccountHandler = async () => {
|
const addAccountHandler = async () => {
|
||||||
setIsAccountCreating(true);
|
setIsAccountCreating(true);
|
||||||
const newAccount = await addAccount(network);
|
const newAccount = await addAccount(network);
|
||||||
setIsAccountCreating(false);
|
setIsAccountCreating(false);
|
||||||
setExpanded(false);
|
newAccount && updateAccounts(newAccount);
|
||||||
|
updateIndex(selectedAccounts[selectedAccounts.length - 1].id + 1);
|
||||||
if (newAccount) {
|
|
||||||
updateAccounts(newAccount);
|
|
||||||
updateIndex(selectedAccounts[selectedAccounts.length - 1].id + 1);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectedAccounts: Account[] = (() => {
|
const selectedAccounts: Account[] = (() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user