From 9bdb2f44b4bdb65cf9de2066f77bc868d5453b5a Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 4 Dec 2023 13:11:15 -0500 Subject: [PATCH] feat(ags notif center): close after clear all --- devices/wim/config/ags/js/notifications/center.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/devices/wim/config/ags/js/notifications/center.js b/devices/wim/config/ags/js/notifications/center.js index d3a7a9e..0dae8f7 100644 --- a/devices/wim/config/ags/js/notifications/center.js +++ b/devices/wim/config/ags/js/notifications/center.js @@ -1,6 +1,8 @@ +import App from 'resource:///com/github/Aylur/ags/app.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import { Button, Label, Box, Icon, Scrollable, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; +import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; import { Notification, HasNotifs } from './base.js'; import EventBox from '../misc/cursorbox.js'; @@ -53,7 +55,10 @@ const NotificationList = () => Box({ // Needs to be wrapped to still have onHover when disabled const ClearButton = () => EventBox({ child: Button({ - onPrimaryClickRelease: () => Notifications.clear(), + onPrimaryClickRelease: () => { + Notifications.clear(); + timeout(1000, () => App.closeWindow('notification-center')); + }, binds: [['sensitive', HasNotifs]], child: Box({ children: [