ags: remove timeout source after notification dismissed (#718)

This commit is contained in:
end-4 2024-08-03 21:21:36 +07:00 committed by GitHub
commit 63d2b30f78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -250,8 +250,12 @@ export default ({
className: 'txt-smaller txt-semibold',
label: initTimeString,
setup: initTimeString == 'Now' ? (self) => {
Utils.timeout(60000, () => self.label = getFriendlyNotifTimeString(notifObject.time))
} : () => {},
let id = Utils.timeout(60000, () => {
self.label = getFriendlyNotifTimeString(notifObject.time);
id = null;
});
self.connect('destroy', () => { if (id) GLib.source_remove(id) });
} : () => { },
});
const notifText = Box({
valign: Gtk.Align.CENTER,