From 828493a0f8def575c1136ec3a36c7f1af77cd253 Mon Sep 17 00:00:00 2001 From: Aaron Cox Date: Mon, 26 Jun 2023 15:56:58 -0700 Subject: [PATCH] Fixed issue with account creation improperly importing as Ledger Fixes #1343 --- app/modules/main/actions/account.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/modules/main/actions/account.js b/app/modules/main/actions/account.js index 227cae452..214dc5a2e 100644 --- a/app/modules/main/actions/account.js +++ b/app/modules/main/actions/account.js @@ -149,15 +149,25 @@ export function createAccount(code, chainId, accountName, activeKey, ownerKey) { }; } -export function createWallet(chainId, accountName, activeKey, isLedger = false) { +export function createWallet(chainId, accountName, activeKey, ledgerMethod = false) { return async (dispatch: () => void, getState) => { const { ledger, settings, storage } = getState(); // Determine the wallet mode (hot vs ledger) let mode = 'hot'; let path; - if (isLedger) { - mode = 'ledger'; - ({ path } = ledger); + if (ledgerMethod) { + switch (ledgerMethod) { + case 'all': + case 'use': + default: { + mode = 'ledger'; + ({ path } = ledger); + break; + } + case 'recover': + mode = 'hot'; + break; + } } // Check to ensure we're using the right key const { blockchains } = getState();