Fix reference to main window when setting Electron window icon

This fixes the fallback path which sets the Electron window icon to the default
icon in case there's no data URI based icon coming content. This is true
immediately after startup, for example.

Part of https://github.com/vector-im/riot-web/issues/9897
This commit is contained in:
J. Ryan Stinnett 2019-06-18 13:59:13 +01:00
parent 8458aa7978
commit f10e7ac224

View file

@ -65,7 +65,7 @@ exports.create = function(config) {
global.mainWindow.webContents.on('page-favicon-updated', async function(ev, favicons) {
if (!favicons || favicons.length <= 0 || !favicons[0].startsWith('data:')) {
if (lastFavicon !== null) {
win.setIcon(defaultIcon);
global.mainWindow.setIcon(defaultIcon);
trayIcon.setImage(defaultIcon);
lastFavicon = null;
}