From f42f71e1a71b1854ea5d093049e19fda5ecde6bd Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Wed, 30 Jan 2019 22:59:33 +0100 Subject: [PATCH] Fix static images paths Fixes #754 --- source/emoji.ts | 5 ++++- source/index.ts | 2 +- source/menu.ts | 2 +- source/tray.ts | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/emoji.ts b/source/emoji.ts index 33f0e08b4..4198eece7 100644 --- a/source/emoji.ts +++ b/source/emoji.ts @@ -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; diff --git a/source/index.ts b/source/index.ts index 71f006975..7ef150649 100644 --- a/source/index.ts +++ b/source/index.ts @@ -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'), diff --git a/source/menu.ts b/source/menu.ts index 04c0284b8..ce13bfa36 100644 --- a/source/menu.ts +++ b/source/menu.ts @@ -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' }) ); diff --git a/source/tray.ts b/source/tray.ts index dad77e877..20ee4fd9b 100644 --- a/source/tray.ts +++ b/source/tray.ts @@ -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()) { @@ -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); } };