mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-16 03:06:27 +00:00
set Notification icon for Windows
This commit is contained in:
@@ -12,13 +12,17 @@ import dataStore from 'boost/dataStore'
|
|||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const { remote, clipboard, ipcRenderer } = electron
|
const { remote, clipboard, ipcRenderer } = electron
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
function hideFinder () {
|
function hideFinder () {
|
||||||
ipcRenderer.send('hide-finder')
|
ipcRenderer.send('hide-finder')
|
||||||
}
|
}
|
||||||
|
|
||||||
function notify (...args) {
|
function notify (title, options) {
|
||||||
return new window.Notification(...args)
|
if (process.platform === 'win32') {
|
||||||
|
options.icon = path.join('file://', global.__dirname, '../../resources/favicon-230x230.png')
|
||||||
|
}
|
||||||
|
return new window.Notification(title, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
require('../styles/finder/index.styl')
|
require('../styles/finder/index.styl')
|
||||||
|
|||||||
@@ -13,14 +13,19 @@ import Tutorial from 'boost/components/modal/Tutorial'
|
|||||||
import activityRecord from 'boost/activityRecord'
|
import activityRecord from 'boost/activityRecord'
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const ipc = electron.ipcRenderer
|
const ipc = electron.ipcRenderer
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
activityRecord.init()
|
activityRecord.init()
|
||||||
window.addEventListener('online', function () {
|
window.addEventListener('online', function () {
|
||||||
ipc.send('check-update', 'check-update')
|
ipc.send('check-update', 'check-update')
|
||||||
})
|
})
|
||||||
|
|
||||||
function notify (...args) {
|
function notify (title, options) {
|
||||||
return new window.Notification(...args)
|
if (process.platform === 'win32') {
|
||||||
|
options.icon = path.join('file://', global.__dirname, '../../resources/favicon-230x230.png')
|
||||||
|
}
|
||||||
|
console.log(options)
|
||||||
|
return new window.Notification(title, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
ipc.on('notify', function (e, payload) {
|
ipc.on('notify', function (e, payload) {
|
||||||
|
|||||||
Reference in New Issue
Block a user