From f10e7ac224393ec5e18e996abd73a0558d05945d Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 18 Jun 2019 13:59:13 +0100 Subject: [PATCH] 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 --- electron_app/src/tray.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/src/tray.js b/electron_app/src/tray.js index bd07d7d4..61e05972 100644 --- a/electron_app/src/tray.js +++ b/electron_app/src/tray.js @@ -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; }