Skip to content

Commit

Permalink
closeNoti - timeout warn added
Browse files Browse the repository at this point in the history
  • Loading branch information
JasminDreasond committed Aug 16, 2023
1 parent cf8cd30 commit 485691b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions electron/main/notification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ export default function startNotifications(ipcMain) {

};

const closeNoti = (event) => {
const closeNoti = (event, forceClose) => {
try {
if (notifications[tag]) {

delete notifications[tag];
e.reply('tiny-notification-close', { tag, event: filterEvent(event) });
e.reply(`tiny-notification-close${forceClose ? '-timeout' : ''}`, { tag, event: filterEvent(event) });

if (data.iconFromWeb && typeof data.iconFile === 'string') {

Expand All @@ -88,7 +88,7 @@ export default function startNotifications(ipcMain) {
notifications[tag].on('close', closeNoti);

// Close
setTimeout(() => closeNoti({}), timeout);
setTimeout(() => closeNoti({}, true), timeout);
e.reply('tiny-notification-create-confirm', { tag, isSupported: Notification.isSupported() });

};
Expand Down

0 comments on commit 485691b

Please sign in to comment.