diff --git a/source/pages/Send/Confirm.tsx b/source/pages/Send/Confirm.tsx index 5959c0cbe..e8b8027b0 100755 --- a/source/pages/Send/Confirm.tsx +++ b/source/pages/Send/Confirm.tsx @@ -121,6 +121,12 @@ export const SendConfirm = () => { // SYSCOIN TRANSACTIONS case isBitcoinBased === true: try { + if (activeAccount.isTrezorWallet) { + await wallet.trezorSigner.init(); + } + if (activeAccount.isLedgerWallet) { + await wallet.ledgerSigner.connectToLedgerDevice(); + } wallet.syscoinTransaction .sendTransaction( { ...basicTxValues, fee: 0.00001 }, diff --git a/source/pages/Settings/ConnectHardwareWallet.tsx b/source/pages/Settings/ConnectHardwareWallet.tsx index aaaad2c0e..227f030c1 100755 --- a/source/pages/Settings/ConnectHardwareWallet.tsx +++ b/source/pages/Settings/ConnectHardwareWallet.tsx @@ -66,7 +66,8 @@ const ConnectHardwareWalletView: FC = () => { try { switch (selectedHardwareWallet) { case 'trezor': - await controller.wallet.importTrezorAccount( + await controller.wallet.trezorSigner.init(); + await controller.wallet.importTrezorAccountFromController( isBitcoinBased ? activeNetwork.currency : 'eth', `${activeNetwork.currency === 'sys' ? '57' : slip44}`, `${trezorAccounts.length}` @@ -93,7 +94,7 @@ const ConnectHardwareWalletView: FC = () => { } if (webHidIsConnected) { - await controller.wallet.importLedgerAccount( + await controller.wallet.importLedgerAccountFromController( isBitcoinBased ? activeNetwork.currency : 'eth', `${activeNetwork.currency === 'sys' ? '57' : slip44}`, `${ledgerAccounts.length}`, diff --git a/source/routers/index.tsx b/source/routers/index.tsx index 9d92be0cb..0f96cd4f1 100644 --- a/source/routers/index.tsx +++ b/source/routers/index.tsx @@ -119,10 +119,10 @@ export const Router = () => { alert.removeAll(); // appRoute(pathname); const isFullscreen = window.innerWidth > 600; - if (isFullscreen) { + if (isFullscreen && isUnlocked) { navigate('/settings/account/hardware'); } - }, [pathname]); + }, [pathname, isUnlocked]); useEffect(() => { if ( diff --git a/source/scripts/Background/controllers/MainController.ts b/source/scripts/Background/controllers/MainController.ts index 7454a93b8..2d37978b7 100644 --- a/source/scripts/Background/controllers/MainController.ts +++ b/source/scripts/Background/controllers/MainController.ts @@ -805,7 +805,7 @@ class MainController extends KeyringManager { return importedAccount; } - public async importTrezorAccount( + public async importTrezorAccountFromController( coin: string, slip44: string, index: string @@ -864,7 +864,7 @@ class MainController extends KeyringManager { return importedAccount; } - public async importLedgerAccount( + public async importLedgerAccountFromController( coin: string, slip44: string, index: string,