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 static images paths #755

Merged
merged 1 commit into from
Jan 31, 2019
Merged
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
Fix static images paths
Fixes #754
CvX committed Jan 30, 2019
commit f42f71e1a71b1854ea5d093049e19fda5ecde6bd
5 changes: 4 additions & 1 deletion source/emoji.ts
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion source/index.ts
Original file line number Diff line number Diff line change
@@ -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'),
2 changes: 1 addition & 1 deletion source/menu.ts
Original file line number Diff line number Diff line change
@@ -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'
})
);
4 changes: 2 additions & 2 deletions source/tray.ts
Original file line number Diff line number Diff line change
@@ -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);
}
};