Skip to content

Commit

Permalink
Fixed issue with account creation improperly importing as Ledger
Browse files Browse the repository at this point in the history
Fixes #1343
  • Loading branch information
aaroncox committed Jun 26, 2023
1 parent c2accb0 commit 828493a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions app/modules/main/actions/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 828493a

Please sign in to comment.