Skip to content

Commit

Permalink
🐛 A JavaScript error occurred in the main process ytmdesktop#324
Browse files Browse the repository at this point in the history
  • Loading branch information
adlerluiz committed Aug 18, 2020
1 parent 664a590 commit 2be76f5
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ if (isMac()) {
'settings-shiny-tray-dark',
nativeTheme.shouldUseDarkColors
)
if (renderer_for_status_bar)
renderer_for_status_bar.send('update-status-bar')
updateStatusBar()
}
)
const menu = Menu.buildFromTemplate(statusBarMenu)
Expand Down Expand Up @@ -333,7 +332,7 @@ function createWindow() {

if (isMac()) {
global.sharedObj.paused = false
renderer_for_status_bar.send('update-status-bar')
updateStatusBar()
}

if (infoPlayerInterval === undefined) {
Expand Down Expand Up @@ -438,7 +437,7 @@ function createWindow() {

if (isMac()) {
global.sharedObj.title = nowPlaying
renderer_for_status_bar.send('update-status-bar')
updateStatusBar()
}

mainWindow.setTitle(nowPlaying)
Expand Down Expand Up @@ -516,7 +515,7 @@ function createWindow() {
logDebug('Playing')
try {
if (isMac()) {
renderer_for_status_bar.send('update-status-bar')
updateStatusBar()
}

global.sharedObj.paused = false
Expand All @@ -531,7 +530,7 @@ function createWindow() {
logDebug('Paused')
try {
if (isMac()) {
renderer_for_status_bar.send('update-status-bar')
updateStatusBar()
}

global.sharedObj.paused = true
Expand Down Expand Up @@ -889,7 +888,7 @@ function createWindow() {

ipcMain.on('update-tray', () => {
if (isMac()) {
renderer_for_status_bar.send('update-status-bar')
updateStatusBar()
tray.setShinyTray()
}
})
Expand Down Expand Up @@ -1805,6 +1804,12 @@ function updateTrayAudioOutputs(data) {
tray.updateTray({ type: 'audioOutputs', data: result })
}

function updateStatusBar() {
if (renderer_for_status_bar != null) {
renderer_for_status_bar.send('update-status-bar')
}
}

function writeLog(log) {
switch (log.type) {
case 'info':
Expand Down

0 comments on commit 2be76f5

Please sign in to comment.