diff --git a/BetterDiscordApp/src/modules/pluginCertifier.js b/BetterDiscordApp/src/modules/pluginCertifier.js index 1c5fa50..c7ee691 100644 --- a/BetterDiscordApp/src/modules/pluginCertifier.js +++ b/BetterDiscordApp/src/modules/pluginCertifier.js @@ -248,7 +248,6 @@ let childModule = BDModules.get(e => e.childContainer)[0] function renderToElements(id, result, filename){ const div = document.getElementById(id) if(!div || div.childNodes.length > 0)return // already certified/div does not exist anymore. - // TODO: implements suspect plugins. if(!flowerStarModule)flowerStarModule = BDModules.get(e => e.flowerStarContainer)[0] if(!childModule)childModule = BDModules.get(e => e.childContainer)[0] diff --git a/modules/discord_desktop_core/core/app/notificationScreen.js b/modules/discord_desktop_core/core/app/notificationScreen.js index fc3e1f5..86d4d8c 100644 --- a/modules/discord_desktop_core/core/app/notificationScreen.js +++ b/modules/discord_desktop_core/core/app/notificationScreen.js @@ -123,6 +123,10 @@ function handleNotificationsClear() { function handleNotificationShow(e, notification) { notifications.push(notification); updateNotifications(); + setTimeout(() => { + if(!notifications.find(e => e.id === notification.id))return + handleNotificationClose(null, notification.id) + }, 3000) } function handleNotificationClick(e, notificationId) { @@ -130,12 +134,16 @@ function handleNotificationClick(e, notificationId) { events.emit(NOTIFICATION_CLICK); } +let isClosing = [] function handleNotificationClose(e, notificationId) { + if(isClosing.includes(notificationId))return if (notificationWindow) { webContentsSend(notificationWindow, 'FADE_OUT', notificationId); } + isClosing.push(notificationId) setTimeout(() => { notifications = notifications.filter(notification => notification.id !== notificationId); + isClosing = isClosing.filter(e => e.id !== notificationId) updateNotifications(); }, VARIABLES.outDuration); }