Skip to content

Commit 506915a

Browse files
committed
feat: First draft fix for HID request keep promping up.
1 parent 436d69c commit 506915a

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

ui/pages/create-account/connect-hardware/account-list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ class AccountList extends Component {
1919
goToNextPage = () => {
2020
// If we have < 5 accounts, it's restricted by BIP-44
2121
if (this.props.accounts.length === 5) {
22-
this.props.getPage(this.props.device, 1, this.props.selectedPath);
22+
this.props.getPage(this.props.device, 1, this.props.selectedPath, false);
2323
} else {
2424
this.props.onAccountRestriction();
2525
}
2626
};
2727

2828
goToPreviousPage = () => {
29-
this.props.getPage(this.props.device, -1, this.props.selectedPath);
29+
this.props.getPage(this.props.device, -1, this.props.selectedPath, false);
3030
};
3131

3232
setPath(pathValue) {

ui/pages/create-account/connect-hardware/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class ConnectHardwareForm extends Component {
149149
}
150150

151151
// Default values
152-
this.getPage(device, 0, this.props.defaultHdPaths[device]);
152+
this.getPage(device, 0, this.props.defaultHdPaths[device], true);
153153
};
154154

155155
onPathChange = (path) => {
@@ -185,9 +185,9 @@ class ConnectHardwareForm extends Component {
185185
}, SECOND * 5);
186186
}
187187

188-
getPage = (device, page, hdPath) => {
188+
getPage = (device, page, hdPath, loadHid) => {
189189
this.props
190-
.connectHardware(device, page, hdPath, this.context.t)
190+
.connectHardware(device, page, hdPath, loadHid, this.context.t)
191191
.then((accounts) => {
192192
if (accounts.length) {
193193
// If we just loaded the accounts for the first time
@@ -475,8 +475,10 @@ const mapDispatchToProps = (dispatch) => {
475475
setHardwareWalletDefaultHdPath: ({ device, path }) => {
476476
return dispatch(actions.setHardwareWalletDefaultHdPath({ device, path }));
477477
},
478-
connectHardware: (deviceName, page, hdPath, t) => {
479-
return dispatch(actions.connectHardware(deviceName, page, hdPath, t));
478+
connectHardware: (deviceName, page, hdPath, loadHid, t) => {
479+
return dispatch(
480+
actions.connectHardware(deviceName, page, hdPath, loadHid, t),
481+
);
480482
},
481483
checkHardwareStatus: (deviceName, hdPath) => {
482484
return dispatch(actions.checkHardwareStatus(deviceName, hdPath));

ui/store/actions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ export function connectHardware(
528528
deviceName: HardwareDeviceNames,
529529
page: string,
530530
hdPath: string,
531+
loadHid: boolean,
531532
t: (key: string) => string,
532533
): ThunkAction<
533534
Promise<{ address: string }[]>,
@@ -546,6 +547,7 @@ export function connectHardware(
546547
let accounts: { address: string }[];
547548
try {
548549
if (
550+
loadHid &&
549551
deviceName === HardwareDeviceNames.ledger &&
550552
ledgerTransportType === LedgerTransportTypes.webhid
551553
) {

0 commit comments

Comments
 (0)