fix wrong object initializer

This commit is contained in:
rafael-aero
2021-07-21 17:04:29 +02:00
parent c4ff481131
commit 7fe8f6e49e
6 changed files with 9 additions and 9 deletions

View File

@@ -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', () => {

View File

@@ -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) => {

View File

@@ -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 = {

View File

@@ -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', () => {

View File

@@ -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 });
});
}
});

View File

@@ -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) => {