Skip to content

Commit 11f52bd

Browse files
committed
Improve notifications
1 parent 3a2988a commit 11f52bd

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

app/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ let trayUpdateIntervalObj = null
7777

7878
log.initialize({ preload: true })
7979

80-
app.setAppUserModelId('net.hovancik.stretchly')
80+
// https://stackoverflow.com/questions/65859634/notification-from-electron-shows-electron-app-electron/65863174#65863174
81+
if (process.platform === 'win32') {
82+
app.setAppUserModelId('Stretchly')
83+
}
8184

8285
const global = {
8386
isNewVersion: false,

app/process-renderer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ window.onload = async (e) => {
1919
const notification = new Notification(title, {
2020
body: text,
2121
requireInteraction: true,
22-
silent
22+
silent,
23+
icon: '../build/icon.ico'
2324
})
2425
setTimeout(() => notification.close(), 7000)
2526
})
@@ -53,7 +54,8 @@ window.onload = async (e) => {
5354
const title = await window.utils.shouldShowNotificationTitle(await window.process.platform(), await window.process.getSystemVersion()) ? 'Stretchly' : ''
5455
const notification = new Notification(title, {
5556
body: await window.i18next.t('process.newVersionAvailable'),
56-
silent
57+
silent,
58+
icon: '../build/icon.ico'
5759
})
5860
notification.onclick = () => window.electronApi.openExternal('https://hovancik.net/stretchly/downloads')
5961
}

0 commit comments

Comments
 (0)