From 401c8ee7b279689ed525162ef40b2493a8cb8231 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Wed, 3 Nov 2021 13:53:13 -0230 Subject: [PATCH] Ensure ledger transport preference is set on import (#12557) --- app/scripts/metamask-controller.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index e0813fcff..2010ce69f 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1317,6 +1317,13 @@ export default class MetamaskController extends EventEmitter { accounts = await keyringController.getAccounts(); } + // This must be set as soon as possible to communicate to the + // keyring's iframe and have the setting initialized properly + // Optimistically called to not block Metamask login due to + // Ledger Keyring GitHub downtime + const transportPreference = this.preferencesController.getLedgerTransportPreference(); + this.setLedgerTransportPreference(transportPreference); + // set new identities this.preferencesController.setAddresses(accounts); this.selectFirstIdentity();