Merge branch 'fix-win10-notifications-icon'
This commit is contained in:
commit
7e34358053
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|
||||||
|
#### Windows
|
||||||
|
- Use the application icon for desktop notifications in Windows 10.
|
||||||
|
|
||||||
#### Linux
|
#### Linux
|
||||||
- Added an option to make the taskbar icon flash on new messages
|
- Added an option to make the taskbar icon flash on new messages
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
const OriginalNotification = Notification;
|
const OriginalNotification = Notification;
|
||||||
|
|
||||||
|
const appIconURL = `file:///${require('electron').remote.app.getAppPath()}/resources/appicon.png`;
|
||||||
|
|
||||||
function override(eventHandlers) {
|
function override(eventHandlers) {
|
||||||
Notification = function(title, options) {
|
Notification = function(title, options) {
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
// Replace with application icon.
|
||||||
|
options.icon = appIconURL;
|
||||||
|
}
|
||||||
|
else if (process.platform === 'darwin') {
|
||||||
// Notification Center shows app's icon, so there were two icons on the notification.
|
// Notification Center shows app's icon, so there were two icons on the notification.
|
||||||
if (process.platform === 'darwin') {
|
|
||||||
delete options.icon;
|
delete options.icon;
|
||||||
}
|
}
|
||||||
this.notification = new OriginalNotification(title, options);
|
this.notification = new OriginalNotification(title, options);
|
||||||
|
|
Loading…
Reference in a new issue