File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -165,13 +165,9 @@ function* handleUsbConnectPybricks(hotPlugDevice?: USBDevice): Generator {
165165 // configuration and it is already selected and that it contains a Pybricks
166166 // interface.
167167
168- if ( ! usbDevice . configuration && usbDevice . configurations . length > 0 ) {
168+ if ( usbDevice . configuration === null ) {
169169 const [ , selectErr ] = yield * call ( ( ) =>
170- maybe (
171- usbDevice . selectConfiguration (
172- usbDevice . configurations [ 0 ] . configurationValue ,
173- ) ,
174- ) ,
170+ maybe ( usbDevice . selectConfiguration ( 1 ) ) ,
175171 ) ;
176172
177173 // TODO: show error message to user here
@@ -183,7 +179,6 @@ function* handleUsbConnectPybricks(hotPlugDevice?: USBDevice): Generator {
183179 }
184180 }
185181
186- assert ( ! ! usbDevice . configuration , 'USB device configuration is undefined' ) ;
187182 assert (
188183 usbDevice . configuration . interfaces . length > 0 ,
189184 'USB device has no interfaces' ,
You can’t perform that action at this time.
0 commit comments