Skip to content

Commit

Permalink
fix: added protection to close only if the unplugged device is the on…
Browse files Browse the repository at this point in the history
…e connected
  • Loading branch information
AlexDygma committed Jul 11, 2023
1 parent 78b0f5b commit f925578
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/setup/configureUSB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export const onUSBDisconnect = async (event: USBEvent) => {
console.log("ProductID", productID);
sendToRenderer("usb-disconnected", vendorID, productID);
const focus = new Focus();
await focus.close();
if (focus.device.usb.vendorId === vendorID && focus.device.usb.productId === productID) {
await focus.close();
}
}
}
};
Expand Down

0 comments on commit f925578

Please sign in to comment.