File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ class WebSerial extends EventTarget {
55
55
navigator . serial . addEventListener ( "connect" , ( e ) => this . handleNewDevice ( e . target ) ) ;
56
56
navigator . serial . addEventListener ( "disconnect" , ( e ) => this . handleRemovedDevice ( e . target ) ) ;
57
57
}
58
- this . isMac = / m a c i n t o s h | m a c o s x / i. test ( navigator . userAgent ) ;
59
58
this . isNeedBatchWrite = false ;
60
59
this . loadDevices ( ) ;
61
60
}
@@ -334,11 +333,12 @@ class WebSerial extends EventTarget {
334
333
}
335
334
336
335
checkIsNeedBatchWrite ( ) {
337
- return this . isMac && vendorIdNames [ this . connectionInfo . usbVendorId ] === "AT32" ;
336
+ const isMac = / m a c i n t o s h | m a c o s x / i. test ( navigator . userAgent ) ;
337
+ return isMac && vendorIdNames [ this . connectionInfo . usbVendorId ] === "AT32" ;
338
338
}
339
339
340
340
async batchWrite ( data ) {
341
- // AT32 on macOS requires smaller chunks (63 bytes) to work correctly due to
341
+ // AT32 on macOS requires smaller chunks (63 bytes) to work correctly due to
342
342
// USB buffer size limitations in the macOS implementation
343
343
const batchWriteSize = 63 ;
344
344
let remainingData = data ;
You can’t perform that action at this time.
0 commit comments