chore: initial linting fixes for JS in docs/fiddles (#37689)

This commit is contained in:
David Sanders 2023-04-05 06:42:20 -07:00 committed by GitHub
parent be32740991
commit db27b9f433
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 122 additions and 134 deletions

View file

@ -1,4 +1,4 @@
const {app, BrowserWindow, ipcMain} = require('electron')
const { app, BrowserWindow, ipcMain } = require('electron')
const path = require('path')
let bluetoothPinCallback
@ -38,7 +38,6 @@ function createWindow () {
})
mainWindow.webContents.session.setBluetoothPairingHandler((details, callback) => {
bluetoothPinCallback = callback
// Send a message to the renderer to prompt the user to confirm the pairing.
mainWindow.webContents.send('bluetooth-pairing-request', details)

View file

@ -4,4 +4,4 @@ contextBridge.exposeInMainWorld('electronAPI', {
cancelBluetoothRequest: (callback) => ipcRenderer.send('cancel-bluetooth-request', callback),
bluetoothPairingRequest: (callback) => ipcRenderer.on('bluetooth-pairing-request', callback),
bluetoothPairingResponse: (response) => ipcRenderer.send('bluetooth-pairing-response', response)
})
})

View file

@ -1,11 +1,11 @@
async function testIt() {
async function testIt () {
const device = await navigator.bluetooth.requestDevice({
acceptAllDevices: true
})
document.getElementById('device-name').innerHTML = device.name || `ID: ${device.id}`
}
document.getElementById('clickme').addEventListener('click',testIt)
document.getElementById('clickme').addEventListener('click', testIt)
function cancelRequest() {
window.electronAPI.cancelBluetoothRequest()
@ -37,4 +37,4 @@ window.electronAPI.bluetoothPairingRequest((event, details) => {
}
window.electronAPI.bluetoothPairingResponse(response)
})
})