Fix #903: JS error when using Electron 7+ and --tray (PR #904)

The API `tray.setHighlightMode(mode)` has been be removed in electron v7.0
without replacement.

This causes the display of an error dialog every time an app is
shown/hidden if the parameter `--tray` is used when nativefying. This is
completely independent form the website you are nativefying and it
happens with all the version of electron after 6.x.

Source: https://www.electronjs.org/docs/api/breaking-changes#tray
This commit is contained in:
Roberto Leinardi 2020-02-17 00:11:48 +01:00 committed by GitHub
parent b927b401b0
commit 261ee2913b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 8 deletions

View File

@ -39,14 +39,6 @@ function createTrayIcon(inpOptions, mainWindow) {
appIcon.on('click', onClick);
mainWindow.on('show', () => {
appIcon.setHighlightMode('always');
});
mainWindow.on('hide', () => {
appIcon.setHighlightMode('never');
});
if (options.counter) {
mainWindow.on('page-title-updated', (e, title) => {
const counterValue = getCounterValue(title);