Skip to content

Commit

Permalink
Fix public path in packaged application
Browse files Browse the repository at this point in the history
  • Loading branch information
coyotte508 committed Sep 22, 2017
1 parent 19aa81a commit 0e77759
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
const {app, BrowserWindow, Tray, Menu} = require('electron');
const url = require('url');
const notifier = require('node-notifier');
const path = require("path");

const gbs = require('./config/globals');
const core = require('./app/core');

//Actual backend
const backend = require('./app/backend');

let logo = path.join(__dirname, 'public', 'logo.png');
let logoGrey = path.join(__dirname, 'public', 'logo-grey.png');

function createWindow () {
// Create the browser window.
gbs.win = new BrowserWindow({
width: 600,
height: 250,
icon: "public/logo.png",
icon: logo,
webPreferences: {
//nodeIntegration: false
},
Expand Down Expand Up @@ -41,7 +45,7 @@ function createWindow () {
}

function generateTray() {
gbs.tray = new Tray('public/logo.png');
gbs.tray = new Tray(logo);

gbs.trayMenu = Menu.buildFromTemplate([
{
Expand Down Expand Up @@ -88,7 +92,7 @@ async function launch() {

function updateTrayIcon() {
console.log("Updating tray icon, connected: ", gbs.connected);
let path = gbs.connected ? 'public/logo.png' : 'public/logo-grey.png';
let path = gbs.connected ? logo : logoGrey;
gbs.tray.setImage(path);
}

Expand Down

0 comments on commit 0e77759

Please sign in to comment.