chore: initial linting fixes for JS in docs/fiddles (#37689)
This commit is contained in:
parent
be32740991
commit
db27b9f433
45 changed files with 122 additions and 134 deletions
|
|
@ -1,5 +1,4 @@
|
|||
const {app, BrowserWindow} = require('electron')
|
||||
const path = require('path')
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
function createWindow () {
|
||||
const mainWindow = new BrowserWindow({
|
||||
|
|
@ -8,24 +7,23 @@ function createWindow () {
|
|||
})
|
||||
|
||||
mainWindow.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => {
|
||||
|
||||
//Add listeners to handle ports being added or removed before the callback for `select-serial-port`
|
||||
//is called.
|
||||
// Add listeners to handle ports being added or removed before the callback for `select-serial-port`
|
||||
// is called.
|
||||
mainWindow.webContents.session.on('serial-port-added', (event, port) => {
|
||||
console.log('serial-port-added FIRED WITH', port)
|
||||
//Optionally update portList to add the new port
|
||||
// Optionally update portList to add the new port
|
||||
})
|
||||
|
||||
mainWindow.webContents.session.on('serial-port-removed', (event, port) => {
|
||||
console.log('serial-port-removed FIRED WITH', port)
|
||||
//Optionally update portList to remove the port
|
||||
// Optionally update portList to remove the port
|
||||
})
|
||||
|
||||
event.preventDefault()
|
||||
if (portList && portList.length > 0) {
|
||||
callback(portList[0].portId)
|
||||
} else {
|
||||
callback('') //Could not find any matching devices
|
||||
callback('') // Could not find any matching devices
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue