From 7fe8f6e49e18153bc114fd0453ed28e08437ea8c Mon Sep 17 00:00:00 2001 From: rafael-aero Date: Wed, 21 Jul 2021 17:04:29 +0200 Subject: [PATCH] fix wrong object initializer --- ElectronNET.Host/api/app.js | 2 +- ElectronNET.Host/api/dialog.js | 4 ++-- ElectronNET.Host/api/menu.js | 2 +- ElectronNET.Host/api/screen.js | 2 +- ElectronNET.Host/api/tray.js | 6 +++--- ElectronNET.Host/api/webContents.js | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ElectronNET.Host/api/app.js b/ElectronNET.Host/api/app.js index bff2625..e9fb535 100644 --- a/ElectronNET.Host/api/app.js +++ b/ElectronNET.Host/api/app.js @@ -151,7 +151,7 @@ module.exports = (socket, app) => { const success = app.requestSingleInstanceLock(); electronSocket.emit('appRequestSingleInstanceLockCompleted', success); app.on('second-instance', (event, args = [], workingDirectory = '') => { - electronSocket.emit('secondInstance', new { args: args, workingDirectory: workingDirectory }); + electronSocket.emit('secondInstance', { args: args, workingDirectory: workingDirectory }); }); }); socket.on('appHasSingleInstanceLock', () => { diff --git a/ElectronNET.Host/api/dialog.js b/ElectronNET.Host/api/dialog.js index 33c287d..5234bcb 100644 --- a/ElectronNET.Host/api/dialog.js +++ b/ElectronNET.Host/api/dialog.js @@ -7,12 +7,12 @@ module.exports = (socket) => { if ('id' in browserWindow) { const window = electron_1.BrowserWindow.fromId(browserWindow.id); const messageBoxReturnValue = await electron_1.dialog.showMessageBox(window, options); - electronSocket.emit('showMessageBoxComplete' + guid, new { response: messageBoxReturnValue.response, checked: messageBoxReturnValue.checkboxChecked }); + electronSocket.emit('showMessageBoxComplete' + guid, { response: messageBoxReturnValue.response, checked: messageBoxReturnValue.checkboxChecked }); } else { const id = guid || options; const messageBoxReturnValue = await electron_1.dialog.showMessageBox(browserWindow); - electronSocket.emit('showMessageBoxComplete' + id, new { response: messageBoxReturnValue.response, checked: messageBoxReturnValue.checkboxChecked }); + electronSocket.emit('showMessageBoxComplete' + id, { response: messageBoxReturnValue.response, checked: messageBoxReturnValue.checkboxChecked }); } }); socket.on('showOpenDialog', async (browserWindow, options, guid) => { diff --git a/ElectronNET.Host/api/menu.js b/ElectronNET.Host/api/menu.js index 0125df3..28fac07 100644 --- a/ElectronNET.Host/api/menu.js +++ b/ElectronNET.Host/api/menu.js @@ -7,7 +7,7 @@ module.exports = (socket) => { socket.on('menu-setContextMenu', (browserWindowId, menuItems) => { const menu = electron_1.Menu.buildFromTemplate(menuItems); addContextMenuItemClickConnector(menu.items, browserWindowId, (id, windowId) => { - electronSocket.emit('contextMenuItemClicked', new { id: id, windowId: windowId }); + electronSocket.emit('contextMenuItemClicked', { id: id, windowId: windowId }); }); const index = contextMenuItems.findIndex(contextMenu => contextMenu.browserWindowId === browserWindowId); const contextMenuItem = { diff --git a/ElectronNET.Host/api/screen.js b/ElectronNET.Host/api/screen.js index 5247695..37a6f2a 100644 --- a/ElectronNET.Host/api/screen.js +++ b/ElectronNET.Host/api/screen.js @@ -15,7 +15,7 @@ module.exports = (socket) => { }); socket.on('register-screen-display-metrics-changed', (id) => { electron_1.screen.on('display-metrics-changed', (event, display, changedMetrics) => { - electronSocket.emit('screen-display-metrics-changed-event' + id, new {display: display, changedMetrics: changedMetrics}); + electronSocket.emit('screen-display-metrics-changed-event' + id, {display: display, changedMetrics: changedMetrics}); }); }); socket.on('screen-getCursorScreenPoint', () => { diff --git a/ElectronNET.Host/api/tray.js b/ElectronNET.Host/api/tray.js index a446a73..0f3a9c9 100644 --- a/ElectronNET.Host/api/tray.js +++ b/ElectronNET.Host/api/tray.js @@ -7,21 +7,21 @@ module.exports = (socket) => { socket.on('register-tray-click', (id) => { if (tray.value) { tray.value.on('click', (event, bounds) => { - electronSocket.emit('tray-click-event' + id, new { eventArgs: event.__proto__, bounds: bounds }); + electronSocket.emit('tray-click-event' + id, { eventArgs: event.__proto__, bounds: bounds }); }); } }); socket.on('register-tray-right-click', (id) => { if (tray.value) { tray.value.on('right-click', (event, bounds) => { - electronSocket.emit('tray-right-click-event' + id, new { eventArgs: event.__proto__, bounds: bounds }); + electronSocket.emit('tray-right-click-event' + id, { eventArgs: event.__proto__, bounds: bounds }); }); } }); socket.on('register-tray-double-click', (id) => { if (tray.value) { tray.value.on('double-click', (event, bounds) => { - electronSocket.emit('tray-double-click-event' + id, new { eventArgs: event.__proto__, bounds: bounds }); + electronSocket.emit('tray-double-click-event' + id, { eventArgs: event.__proto__, bounds: bounds }); }); } }); diff --git a/ElectronNET.Host/api/webContents.js b/ElectronNET.Host/api/webContents.js index 932c4c3..647a6ca 100644 --- a/ElectronNET.Host/api/webContents.js +++ b/ElectronNET.Host/api/webContents.js @@ -141,7 +141,7 @@ module.exports = (socket) => { const browserWindow = getWindowById(id); browserWindow.webContents.session.cookies.removeAllListeners('changed'); browserWindow.webContents.session.cookies.on('changed', (event, cookie, cause, removed) => { - electronSocket.emit('webContents-session-cookies-changed' + id, new { cookie: cookie, cause: cause, removed: removed }); + electronSocket.emit('webContents-session-cookies-changed' + id, { cookie: cookie, cause: cause, removed: removed }); }); }); socket.on('webContents-session-cookies-get', async (id, filter, guid) => {