(dev: f.Device)
| 135 | } |
| 136 | |
| 137 | public async deviceRemoved(dev: f.Device) { |
| 138 | this.devices = this.devices.filter((d) => d.id !== dev.id); |
| 139 | if (this.currentDevice?.id === dev.id) { |
| 140 | let nextDevice: f.Device | undefined; |
| 141 | |
| 142 | // Try to select the next-best device |
| 143 | if (this.devices.length) { |
| 144 | const supportedPlatforms = await this.getSupportedPlatformsForWorkspace(); |
| 145 | const supportedDevices = this.devices.filter((d) => this.isSupported(supportedPlatforms, d)); |
| 146 | if (supportedDevices?.length) |
| 147 | nextDevice = supportedDevices[0]; |
| 148 | } |
| 149 | |
| 150 | this.setCurrentDevice(nextDevice); |
| 151 | } |
| 152 | |
| 153 | void this.updateStatusBar(); |
| 154 | this.onDeviceRemovedEmitter.fire(dev.id); |
| 155 | this.onDevicesChangedEmitter.fire(); |
| 156 | } |
| 157 | |
| 158 | public async showDevicePicker(supportedTypes: f.PlatformType[] | undefined, projectRoot: string | undefined): Promise<f.Device | undefined> { |
| 159 | // If we weren't passed any supported types, we should try to get them for |
nothing calls this directly
no test coverage detected