Loading lib/fastboot.js +13 −4 Original line number Diff line number Diff line Loading @@ -115,15 +115,13 @@ export class FastbootDevice { await this.device.claimInterface(0); // fastboot } catch (error) { // Propagate exception from waitForConnect() let rejected = false; if (this._connectReject !== null) { this._connectReject(error); this._connectResolve = null; this._connectReject = null; rejected = true; } if (rethrowErrors && rejected) { if (rethrowErrors) { throw error; } } Loading Loading @@ -223,7 +221,18 @@ export class FastbootDevice { navigator.usb.addEventListener("connect", async (event) => { common.logDebug("USB device connected"); this.device = event.device; // Check whether waitForConnect() is pending and save it for later let hasPromiseReject = this._connectReject !== null; try { await this._validateAndConnectDevice(false); } catch (error) { // Only rethrow errors from the event handler if waitForConnect() // didn't already handle them if (!hasPromiseReject) { throw error; } } }); this._registeredUsbListeners = true; Loading Loading
lib/fastboot.js +13 −4 Original line number Diff line number Diff line Loading @@ -115,15 +115,13 @@ export class FastbootDevice { await this.device.claimInterface(0); // fastboot } catch (error) { // Propagate exception from waitForConnect() let rejected = false; if (this._connectReject !== null) { this._connectReject(error); this._connectResolve = null; this._connectReject = null; rejected = true; } if (rethrowErrors && rejected) { if (rethrowErrors) { throw error; } } Loading Loading @@ -223,7 +221,18 @@ export class FastbootDevice { navigator.usb.addEventListener("connect", async (event) => { common.logDebug("USB device connected"); this.device = event.device; // Check whether waitForConnect() is pending and save it for later let hasPromiseReject = this._connectReject !== null; try { await this._validateAndConnectDevice(false); } catch (error) { // Only rethrow errors from the event handler if waitForConnect() // didn't already handle them if (!hasPromiseReject) { throw error; } } }); this._registeredUsbListeners = true; Loading