Skip to content

Commit 958469f

Browse files
committed
set Notification icon for Windows
1 parent 2a774a7 commit 958469f

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

browser/finder/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ import dataStore from 'boost/dataStore'
1212

1313
const electron = require('electron')
1414
const { remote, clipboard, ipcRenderer } = electron
15+
const path = require('path')
1516

1617
function hideFinder () {
1718
ipcRenderer.send('hide-finder')
1819
}
1920

20-
function notify (...args) {
21-
return new window.Notification(...args)
21+
function notify (title, options) {
22+
if (process.platform === 'win32') {
23+
options.icon = path.join('file://', global.__dirname, '../../resources/favicon-230x230.png')
24+
}
25+
return new window.Notification(title, options)
2226
}
2327

2428
require('../styles/finder/index.styl')

browser/main/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@ import Tutorial from 'boost/components/modal/Tutorial'
1313
import activityRecord from 'boost/activityRecord'
1414
const electron = require('electron')
1515
const ipc = electron.ipcRenderer
16+
const path = require('path')
1617

1718
activityRecord.init()
1819
window.addEventListener('online', function () {
1920
ipc.send('check-update', 'check-update')
2021
})
2122

22-
function notify (...args) {
23-
return new window.Notification(...args)
23+
function notify (title, options) {
24+
if (process.platform === 'win32') {
25+
options.icon = path.join('file://', global.__dirname, '../../resources/favicon-230x230.png')
26+
}
27+
console.log(options)
28+
return new window.Notification(title, options)
2429
}
2530

2631
ipc.on('notify', function (e, payload) {

0 commit comments

Comments
 (0)