Skip to content

feat: Fix plan 835 Hid request dialog keep on prompting up during pagination. #30384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
506915a
feat: First draft fix for HID request keep promping up.
dawnseeker8 Feb 18, 2025
2dcab12
Merge branch 'main' into feat/plan-836-ledger-hid-prompt-up-issue
dawnseeker8 Feb 18, 2025
cf89481
Merge branch 'main' into feat/plan-836-ledger-hid-prompt-up-issue
dawnseeker8 Feb 19, 2025
d5a8a67
Merge branch 'main' into feat/plan-836-ledger-hid-prompt-up-issue
dawnseeker8 Mar 6, 2025
1359e03
fix: add unit tests to test connectHardware, mock HID connection with…
dawnseeker8 Mar 7, 2025
a438e07
Fix: unit tests to cover the getPage() method.
dawnseeker8 Mar 10, 2025
14a74d6
Merge branch 'main' into feat/plan-836-ledger-hid-prompt-up-issue
dawnseeker8 Mar 11, 2025
26b2b62
fix: refactor the unit test description.
dawnseeker8 Mar 11, 2025
064f3c3
fix: Remove unused comments.
dawnseeker8 Mar 11, 2025
29d8173
Merge branch 'main' into feat/plan-836-ledger-hid-prompt-up-issue
dawnseeker8 Mar 12, 2025
1900595
Merge branch 'main' into feat/plan-836-ledger-hid-prompt-up-issue
dawnseeker8 Mar 13, 2025
56674c0
Merge branch 'main' into feat/plan-836-ledger-hid-prompt-up-issue
dawnseeker8 Mar 13, 2025
7cd20ee
Merge branch 'main' into feat/plan-836-ledger-hid-prompt-up-issue
dawnseeker8 Mar 14, 2025
1ce4a8f
fix: update unit tests snapshot.
dawnseeker8 Mar 14, 2025
567ef59
Merge branch 'main' into feat/plan-836-ledger-hid-prompt-up-issue
dawnseeker8 Mar 14, 2025
6be0307
Update ui/pages/create-account/connect-hardware/__snapshots__/index.t…
dawnseeker8 Mar 18, 2025
40caace
Merge branch 'main' into feat/plan-836-ledger-hid-prompt-up-issue
dawnseeker8 Mar 18, 2025
a0600d4
fix: update latest snapshot after rebase to fix unit tests.
dawnseeker8 Mar 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui/pages/create-account/connect-hardware/account-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class AccountList extends Component {
goToNextPage = () => {
// If we have < 5 accounts, it's restricted by BIP-44
if (this.props.accounts.length === 5) {
this.props.getPage(this.props.device, 1, this.props.selectedPath);
this.props.getPage(this.props.device, 1, this.props.selectedPath, false);
} else {
this.props.onAccountRestriction();
}
};

goToPreviousPage = () => {
this.props.getPage(this.props.device, -1, this.props.selectedPath);
this.props.getPage(this.props.device, -1, this.props.selectedPath, false);
};

setPath(pathValue) {
Expand Down
12 changes: 7 additions & 5 deletions ui/pages/create-account/connect-hardware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ConnectHardwareForm extends Component {
}

// Default values
this.getPage(device, 0, this.props.defaultHdPaths[device]);
this.getPage(device, 0, this.props.defaultHdPaths[device], true);
};

onPathChange = (path) => {
Expand Down Expand Up @@ -185,9 +185,9 @@ class ConnectHardwareForm extends Component {
}, SECOND * 5);
}

getPage = (device, page, hdPath) => {
getPage = (device, page, hdPath, loadHid) => {
this.props
.connectHardware(device, page, hdPath, this.context.t)
.connectHardware(device, page, hdPath, loadHid, this.context.t)
.then((accounts) => {
if (accounts.length) {
// If we just loaded the accounts for the first time
Expand Down Expand Up @@ -475,8 +475,10 @@ const mapDispatchToProps = (dispatch) => {
setHardwareWalletDefaultHdPath: ({ device, path }) => {
return dispatch(actions.setHardwareWalletDefaultHdPath({ device, path }));
},
connectHardware: (deviceName, page, hdPath, t) => {
return dispatch(actions.connectHardware(deviceName, page, hdPath, t));
connectHardware: (deviceName, page, hdPath, loadHid, t) => {
return dispatch(
actions.connectHardware(deviceName, page, hdPath, loadHid, t),
);
},
checkHardwareStatus: (deviceName, hdPath) => {
return dispatch(actions.checkHardwareStatus(deviceName, hdPath));
Expand Down
2 changes: 2 additions & 0 deletions ui/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ export function connectHardware(
deviceName: HardwareDeviceNames,
page: string,
hdPath: string,
loadHid: boolean,
t: (key: string) => string,
): ThunkAction<
Promise<{ address: string }[]>,
Expand All @@ -617,6 +618,7 @@ export function connectHardware(
let accounts: { address: string }[];
try {
if (
loadHid &&
deviceName === HardwareDeviceNames.ledger &&
ledgerTransportType === LedgerTransportTypes.webhid
) {
Expand Down
Loading