timeLimitsManager: Hide ‘limit reached’ notification when reset

If the user changes their daily limit setting so that they’ve no longer
reached their limit, remove the ‘limit reached’ notification from the
message tray, if it’s still there, when disabling greyscale mode.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8164
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3603>
This commit is contained in:
Philip Withnall 2025-01-20 13:43:35 +00:00 committed by Marge Bot
parent c890a2f1e3
commit 72cb52e743

View File

@ -967,6 +967,9 @@ class TimeLimitsNotificationSource extends GObject.Object {
console.debug(`TimeLimitsNotificationSource: ${remainingSecs}s left before limit is reached`);
if (remainingSecs > LIMIT_UPCOMING_NOTIFICATION_TIME_SECONDS) {
this._notification?.destroy();
this._notification = null;
// Schedule to show a notification when the upcoming notification
// time is reached.
this._scheduleUpdateState(remainingSecs - LIMIT_UPCOMING_NOTIFICATION_TIME_SECONDS);