From 8ba26af23586f32d6b39d954cea07a41135655c2 Mon Sep 17 00:00:00 2001 From: Abhinav-grd Date: Fri, 4 Jun 2021 14:53:59 +0530 Subject: [PATCH] imporve formatting main.js --- src/main.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main.ts b/src/main.ts index 228bb4ca8..fafaa3db3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,7 +21,7 @@ function createWindow() { const appImgPath = isDev ? 'build/window-icon.png' : path.join(process.resourcesPath, 'window-icon.png'); - let appIcon = nativeImage.createFromPath(appImgPath); + const appIcon = nativeImage.createFromPath(appImgPath); // Create the browser window. const mainWindow = new BrowserWindow({ height: 600, @@ -59,8 +59,8 @@ function createWindow() { isDev ? mainWindow.loadFile(`../build/error.html`) : splash.loadURL( - `file://${path.join(process.resourcesPath, 'error.html')}` - ); + `file://${path.join(process.resourcesPath, 'error.html')}` + ); }); mainWindow.once('ready-to-show', () => { mainWindow.show(); @@ -93,14 +93,14 @@ app.on('ready', () => { const trayImgPath = isDev ? 'build/taskbar-icon.png' : path.join(process.resourcesPath, 'taskbar-icon.png'); - let trayIcon = nativeImage.createFromPath(trayImgPath); + const trayIcon = nativeImage.createFromPath(trayImgPath); tray = new Tray(trayIcon); tray.setToolTip('ente'); tray.setContextMenu(buildContextMenu()); }); ipcMain.on('select-dir', async (event) => { - let dialogWindow = new BrowserWindow({ + const dialogWindow = new BrowserWindow({ width: 800, height: 600, webPreferences: { @@ -131,7 +131,7 @@ ipcMain.on('send-notification', (event, args) => { new Notification(notification).show(); }); ipcMain.on('reload-window', (event, args) => { - let secondWindow = createWindow(); + const secondWindow = createWindow(); mainWindow.destroy(); mainWindow = secondWindow; }); @@ -140,15 +140,15 @@ function buildContextMenu(export_progress: any = null) { const contextMenu = Menu.buildFromTemplate([ ...(export_progress ? [ - { - label: export_progress, - click: () => mainWindow.show(), - }, - { - label: 'stop export', - click: () => mainWindow.webContents.send('stop-export'), - }, - ] + { + label: export_progress, + click: () => mainWindow.show(), + }, + { + label: 'stop export', + click: () => mainWindow.webContents.send('stop-export'), + }, + ] : []), { type: 'separator' }, {