Skip to content

Commit

Permalink
🐛 Add check for ytmdesktop#87
Browse files Browse the repository at this point in the history
  • Loading branch information
mingjun97 committed Jan 19, 2020
1 parent 97870ce commit 7e48627
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions providers/trayProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,28 @@ function createTray(mainWindow, icon) {
}

function balloon(title, content, cover) {
base64Img.requestBase64(cover, function(err, res, body) {
var image = nativeImage.createFromDataURL(body);

if (settingsProvider.get("settings-show-notifications")) {
if (title && content) {
if (process.platform == "win32") {
tray.displayBalloon({
icon: image,
title: title,
content: content
});
} else {
new Notification(title, {
body: content,
icon: image
});
if (title && content && cover) {
base64Img.requestBase64(cover, function(err, res, body) {
var image = nativeImage.createFromDataURL(body);

if (settingsProvider.get("settings-show-notifications")) {
if (title && content) {
if (process.platform == "win32") {
tray.displayBalloon({
icon: image,
title: title,
content: content
});
} else {
new Notification(title, {
body: content,
icon: image
});
}
}
}
}
});
});
}
}

function quit() {
Expand Down

0 comments on commit 7e48627

Please sign in to comment.