From b6d95a6edc9a339634ec990721f6775f536b4f7e Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Wed, 11 Jul 2018 21:10:42 -0400 Subject: [PATCH] Simplified electron main.js --- main.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/main.js b/main.js index ca6f5a8..720cfcb 100644 --- a/main.js +++ b/main.js @@ -1,22 +1,23 @@ -const {app, BrowserWindow, Menu} = require('electron'); +const {app, BrowserWindow, Menu, nativeImage} = require('electron'); const path = require('path'); const url = require('url'); let win; function createWindow() { - win = new BrowserWindow({width: 1000, height: 800, icon: path.join(__dirname, 'assets/img/logo.png')}); + let image = nativeImage.createFromPath('assets/img/logo.png'); + + win = new BrowserWindow({ + width: 1000, + height: 800, + icon: image, + title: 'Formula Manager 2.0' + }); Menu.setApplicationMenu(null); // load the dist folder from Angular - win.loadURL( - url.format({ - pathname: path.join(__dirname, 'public/index.html'), - protocol: 'file:', - slashes: true - }) - ); + win.loadURL('https://fhsons.zakscode.com/formulaManager'); // Open the DevTools optionally: win.webContents.openDevTools();