@@ -126,7 +126,9 @@ class CapacitorSerial extends EventTarget {
126126 }
127127
128128 async loadDevices ( ) {
129- if ( ! this . pluginAvailable ) return ;
129+ if ( ! this . pluginAvailable ) {
130+ return ;
131+ }
130132
131133 try {
132134 const result = await BetaflightSerial . getDevices ( ) ;
@@ -140,7 +142,9 @@ class CapacitorSerial extends EventTarget {
140142
141143 async requestPermissionDevice ( ) {
142144 let newPermissionPort = null ;
143- if ( ! this . pluginAvailable ) return null ;
145+ if ( ! this . pluginAvailable ) {
146+ return null ;
147+ }
144148
145149 try {
146150 console . log ( `${ logHead } Requesting USB permissions...` ) ;
@@ -164,7 +168,9 @@ class CapacitorSerial extends EventTarget {
164168 }
165169
166170 async connect ( path , options ) {
167- if ( ! this . pluginAvailable ) return false ;
171+ if ( ! this . pluginAvailable ) {
172+ return false ;
173+ }
168174
169175 const baudRate = options ?. baudRate ?? 115200 ;
170176 // Prevent double connections
@@ -239,7 +245,9 @@ class CapacitorSerial extends EventTarget {
239245 }
240246
241247 async disconnect ( ) {
242- if ( ! this . pluginAvailable ) return true ;
248+ if ( ! this . pluginAvailable ) {
249+ return true ;
250+ }
243251
244252 if ( ! this . connected ) {
245253 return true ;
@@ -265,7 +273,9 @@ class CapacitorSerial extends EventTarget {
265273
266274 async send ( data , callback ) {
267275 if ( ! this . pluginAvailable ) {
268- if ( callback ) callback ( { bytesSent : 0 } ) ;
276+ if ( callback ) {
277+ callback ( { bytesSent : 0 } ) ;
278+ }
269279 return { bytesSent : 0 } ;
270280 }
271281
0 commit comments