diff --git a/.config/ags/lib/notification.js b/.config/ags/lib/notification.js index e722f1184..628b01177 100644 --- a/.config/ags/lib/notification.js +++ b/.config/ags/lib/notification.js @@ -435,17 +435,17 @@ export default ({ }) widget.add(notificationBox); wholeThing.child.children = [widget]; - // if (isPopup) Utils.timeout(popupTimeout, () => { - // if (wholeThing) { - // wholeThing.revealChild = false; - // Utils.timeout(200, () => { - // if (wholeThing) { - // wholeThing.destroy(); - // wholeThing = null; - // } - // command(); - // }, wholeThing); - // } - // }) + if (isPopup) Utils.timeout(popupTimeout, () => { + if (wholeThing) { + wholeThing.revealChild = false; + Utils.timeout(200, () => { + if (wholeThing) { + wholeThing.destroy(); + wholeThing = null; + } + command(); + }, wholeThing); + } + }) return wholeThing; } diff --git a/.config/ags/widgets/indicators/notificationpopups.js b/.config/ags/widgets/indicators/notificationpopups.js index f918ee5d9..ab8e68af9 100644 --- a/.config/ags/widgets/indicators/notificationpopups.js +++ b/.config/ags/widgets/indicators/notificationpopups.js @@ -10,12 +10,14 @@ export default () => Box({ attribute: { 'map': new Map(), 'dismiss': (box, id, force = false) => { - if (!id || !box.attribute.map.has(id) || box.attribute.map.get(id).attribute.hovered && !force) + if (!id || !box.attribute.map.has(id)) return; + const notifWidget = box.attribute.map.get(id); + if (notifWidget == null || notifWidget.attribute.hovered && !force) + return; // cuz already destroyed - const notif = box.attribute.map.get(id); - notif.revealChild = false; - notif.attribute.destroyWithAnims(); + notifWidget.revealChild = false; + notifWidget.attribute.destroyWithAnims(); box.attribute.map.delete(id); }, 'notify': (box, id) => {