Skip to content

Commit

Permalink
Uniquely identify a device is of type UsbDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Aug 9, 2024
1 parent 86a7665 commit 421bc1b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/cmd/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ module.exports = class KeysCommand {

console.log();
console.log(url.format(result));
return result;
}

_getServerKeySegment({ protocol }){
Expand Down
5 changes: 4 additions & 1 deletion src/cmd/usb-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ async function executeWithUsbDevice({ args, func, enterDfuMode = false, allowPro
}
newDeviceHandle = await func(device);
// Overwrite device handle if it is provided by the executed function
device = newDeviceHandle || device;
// FIXME: Perhaps a poor way to uniquely identify a device is of UsbDevice type
if (newDeviceHandle?._dev) {
device = newDeviceHandle;
}
} finally {
if (deviceIsProtected) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/usb.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ module.exports = class UsbCommand extends CLICommandBase {

async _cloudStatus(device, until, timeout) {
let status = null;

this.newSpin('Querying device...').start();
if (!until) {
status = await device.getCloudConnectionStatus();
Expand Down

0 comments on commit 421bc1b

Please sign in to comment.