Skip to content

Commit

Permalink
🐛 Fix ytmdesktop#367 migrate to electron internal Notifiations API
Browse files Browse the repository at this point in the history
  • Loading branch information
atcq committed Sep 13, 2020
1 parent e4c5e30 commit 5fad6bf
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 11 deletions.
75 changes: 69 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"electron-is-dev": "^1.2.0",
"electron-localshortcut": "^3.2.1",
"electron-log": "^4.2.2",
"electron-native-notification": "^1.2.1",
"electron-store": "^6.0.0",
"electron-updater": "^4.3.4",
"i18n": "^0.10.0",
Expand Down
10 changes: 6 additions & 4 deletions src/providers/trayProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const systemInfo = require('../utils/systemInfo')
const imageToBase64 = require('image-to-base64')
const { popUpMenu } = require('./templateProvider')
const assetsProvider = require('./assetsProvider')
const { Notification } = require('electron')

let tray = null
let saved_mainWindow = null
Expand Down Expand Up @@ -154,13 +155,14 @@ function _doNotification(title, content, icon) {
}, 7 * 1000)
}
} else {
let Notification = require('electron-native-notification')

new Notification(title, {
// create a system notification and send it
let myNotification = new Notification({
title: title,
body: content,
silent: true,
icon: icon,
})
urgency: 'low',
}).show()
}
}
} catch (error) {
Expand Down

0 comments on commit 5fad6bf

Please sign in to comment.