1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

Provide instructions for users switching from Ledger Live to WebHID (#12519)

This commit is contained in:
David Walsh 2021-10-28 18:38:58 -05:00 committed by ryanml
parent 904dad256f
commit b824054557
3 changed files with 22 additions and 0 deletions

View File

@ -1287,6 +1287,9 @@
"ledgerTimeout": {
"message": "Ledger Live is taking too long to respond or connection timeout. Make sure Ledger Live app is opened and your device is unlocked."
},
"ledgerTransportChangeWarning": {
"message": "If your Ledger Live app is open, please disconnect any open Ledger Live connection and close the Ledger Live app."
},
"ledgerWebHIDNotConnectedErrorMessage": {
"message": "The ledger device was not connected. If you wish to connect your Ledger, please click 'Continue' again and approve HID connection",
"description": "An error message shown to the user during the hardware connect flow."

View File

@ -7,6 +7,7 @@ import TextField from '../../../components/ui/text-field';
import Button from '../../../components/ui/button';
import { MOBILE_SYNC_ROUTE } from '../../../helpers/constants/routes';
import Dropdown from '../../../components/ui/dropdown';
import Dialog from '../../../components/ui/dialog';
import {
LEDGER_TRANSPORT_TYPES,
@ -51,6 +52,7 @@ export default class AdvancedTab extends PureComponent {
lockTimeError: '',
ipfsGateway: this.props.ipfsGateway,
ipfsGatewayError: '',
showLedgerTransportWarning: false,
};
renderMobileSync() {
@ -458,6 +460,12 @@ export default class AdvancedTab extends PureComponent {
options={transportTypeOptions}
selectedOption={ledgerTransportType}
onChange={async (transportType) => {
if (
ledgerTransportType === LEDGER_TRANSPORT_TYPES.LIVE &&
transportType === LEDGER_TRANSPORT_TYPES.WEBHID
) {
this.setState({ showLedgerTransportWarning: true });
}
setLedgerLivePreference(transportType);
if (
transportType === LEDGER_TRANSPORT_TYPES.WEBHID &&
@ -469,6 +477,13 @@ export default class AdvancedTab extends PureComponent {
}
}}
/>
{this.state.showLedgerTransportWarning ? (
<Dialog type="message">
<div className="settings-page__content-item-dialog">
{t('ledgerTransportChangeWarning')}
</div>
</Dialog>
) : null}
</div>
</div>
</div>

View File

@ -190,6 +190,10 @@
cursor: not-allowed;
opacity: 0.5;
}
& .dialog {
margin-top: 10px;
}
}
&__content-label {