Skip to content

Commit

Permalink
Fix static images paths (#755)
Browse files Browse the repository at this point in the history
Fixes #754
  • Loading branch information
CvX authored and sindresorhus committed Jan 31, 2019
1 parent 8030cc9 commit 9b34f7a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion source/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ function getEmojiIcon(style: EmojiStyle): NativeImage {
return cachedIcon;
}

const image = nativeImage.createFromPath(path.join(__dirname, 'static', `emoji-${style}.png`));
const image = nativeImage.createFromPath(
path.join(__dirname, '..', 'static', `emoji-${style}.png`)
);

menuIcons.set(style, image);

return image;
Expand Down
2 changes: 1 addition & 1 deletion source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function createMainWindow(): BrowserWindow {
y: lastWindowState.y,
width: lastWindowState.width,
height: lastWindowState.height,
icon: is.linux ? path.join(__dirname, 'static/Icon.png') : undefined,
icon: is.linux ? path.join(__dirname, '..', 'static', 'Icon.png') : undefined,
minWidth: 400,
minHeight: 200,
alwaysOnTop: config.get('alwaysOnTop'),
Expand Down
2 changes: 1 addition & 1 deletion source/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ ${debugInfo()}`;
type: 'separator'
},
aboutMenuItem({
icon: path.join(__dirname, 'static/Icon.png'),
icon: path.join(__dirname, '..', 'static', 'Icon.png'),
text: 'Created by Sindre Sorhus'
})
);
Expand Down
4 changes: 2 additions & 2 deletions source/tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
return;
}

const iconPath = path.join(__dirname, 'static/IconTray.png');
const iconPath = path.join(__dirname, '..', 'static', 'IconTray.png');

const toggleWin = (): void => {
if (win.isVisible()) {
Expand Down Expand Up @@ -47,7 +47,7 @@ export default {
}

const icon = shouldDisplayUnread ? 'IconTrayUnread.png' : 'IconTray.png';
const iconPath = path.join(__dirname, `static/${icon}`);
const iconPath = path.join(__dirname, '..', 'static', icon);
tray.setImage(iconPath);
}
};

0 comments on commit 9b34f7a

Please sign in to comment.