See #1 Fixed tray icon disappearing.

This commit is contained in:
Quentin Decaunes 2019-03-01 17:09:09 +01:00
parent 56a3c4ff62
commit 551b61a644

View File

@ -11,6 +11,7 @@ const {app, BrowserWindow, Menu, Tray} = require('electron')
// Keep a global reference of the window object, if you don't, the window will // Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected. // be closed automatically when the JavaScript object is garbage collected.
let mainWindow let mainWindow
let tray
function createWindow () { function createWindow () {
// Create the browser window. // Create the browser window.
@ -62,8 +63,8 @@ function createWindow () {
} }
]); ]);
var appIcon = new Tray(__dirname + '/assets/icon.ico'); tray = new Tray(__dirname + '/assets/icon.ico');
appIcon.setContextMenu(contextMenu); tray.setContextMenu(contextMenu);
} }
// This method will be called when Electron has finished // This method will be called when Electron has finished