Fix double video and broken tray icon

This commit is contained in:
Shawn 2019-03-15 17:09:14 -05:00
parent 20c18db7f6
commit c040c7cb4e
3 changed files with 13 additions and 1 deletions

View file

@ -3,6 +3,7 @@ import path from 'path';
export default window => {
let iconPath;
switch (process.platform) {
case 'darwin': {
iconPath = 'static/img/tray/mac/trayTemplate.png';
@ -17,7 +18,9 @@ export default window => {
}
}
const tray = new Tray(iconPath);
const tray = new Tray(
process.env.NODE_ENV === 'development' ? iconPath : path.join(process.resourcesPath, iconPath)
);
tray.on('double-click', () => {
window.show();

View file

@ -144,6 +144,14 @@ class MediaPlayer extends React.PureComponent<Props, State> {
else {
// Temp hack to help in some metadata loading cases
setTimeout(() => {
const currentMediaContainer = this.mediaContainer.current;
// Clean any potential rogue instances
while (currentMediaContainer.firstChild) {
currentMediaContainer.removeChild(currentMediaContainer.firstChild);
}
player.append(
{
name: fileName,

View file

@ -53,6 +53,7 @@ if (process.env.NODE_ENV === 'production') {
mainConfig = merge(mainConfig, {
externals: {
keytar: 'require("keytar")',
electron: 'require("electron")',
},
});
} else {