Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default Electron window and tray icons #10097

Merged
merged 3 commits into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified electron_app/img/riot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion electron_app/src/electron-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ app.on('ready', () => {
console.log('No update_base_url is defined: auto update is disabled');
}

const iconPath = `${__dirname}/../img/riot.${process.platform === 'win32' ? 'ico' : 'png'}`;
// It's important to call `path.join` so we don't end up with the packaged
// asar in the final path.
const iconFile = `riot.${process.platform === 'win32' ? 'ico' : 'png'}`;
const iconPath = path.join(__dirname, "..", "..", "img", iconFile);

// Load the previous window state with fallback to defaults
const mainWindowState = windowStateKeeper({
Expand Down
2 changes: 1 addition & 1 deletion electron_app/src/tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@
"electronVersion": "4.2.4",
"files": [
"node_modules/**",
"src/**",
"img/**"
"src/**"
],
"extraResources": [
{ "from": "electron_app/img", "to": "img" },
"webapp/**/*",
"origin_migrator/**/*"
],
Expand Down