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 => { export default window => {
let iconPath; let iconPath;
switch (process.platform) { switch (process.platform) {
case 'darwin': { case 'darwin': {
iconPath = 'static/img/tray/mac/trayTemplate.png'; 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', () => { tray.on('double-click', () => {
window.show(); window.show();

View file

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

View file

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