Add a fallback when the notification icon theme is not valid - the app did not start up successfully before
This commit is contained in:
21
src/main.js
21
src/main.js
@@ -153,12 +153,21 @@ const trayImages = (() => {
|
|||||||
}
|
}
|
||||||
case 'linux':
|
case 'linux':
|
||||||
{
|
{
|
||||||
const theme = config.trayIconTheme || 'light';
|
const theme = config.trayIconTheme;
|
||||||
return {
|
try {
|
||||||
normal: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', theme, 'MenuIconTemplate.png')),
|
return {
|
||||||
unread: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', theme, 'MenuIconUnreadTemplate.png')),
|
normal: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', theme, 'MenuIconTemplate.png')),
|
||||||
mention: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', theme, 'MenuIconMentionTemplate.png'))
|
unread: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', theme, 'MenuIconUnreadTemplate.png')),
|
||||||
};
|
mention: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', theme, 'MenuIconMentionTemplate.png'))
|
||||||
|
};
|
||||||
|
} catch (e) {
|
||||||
|
//Fallback for invalid theme setting
|
||||||
|
return {
|
||||||
|
normal: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', 'light', 'MenuIconTemplate.png')),
|
||||||
|
unread: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', 'light', 'MenuIconUnreadTemplate.png')),
|
||||||
|
mention: nativeImage.createFromPath(path.resolve(assetsDir, 'linux', 'light', 'MenuIconMentionTemplate.png'))
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
|
Reference in New Issue
Block a user