Skip to content

Commit 806367f

Browse files
delay badge on windows
1 parent 4cf38cf commit 806367f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

main.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,16 @@ async function createWindow () {
156156
mainWindow.on('blur', () => {
157157
mainWindow.webContents.send('blur');
158158
});
159+
let badgeTs = 0;
159160
ipcMain.on('update-badge', (event, count) => {
160-
app.setBadgeCount(count);
161+
if (Date.now() - badgeTs < 100 && process.platform === 'win32')
162+
setTimeout(() => {
163+
app.setBadgeCount(count);
164+
badgeTs = Date.now();
165+
}, 100);
166+
else
167+
app.setBadgeCount(count);
168+
badgeTs = Date.now();
161169
});
162170
ipcMain.on('relaunch', () => {
163171
app.relaunch();

0 commit comments

Comments
 (0)