summaryrefslogtreecommitdiff
path: root/src/widgets/notification.tsx
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-22 19:58:07 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-22 19:58:07 +1100
commitcf55e2613314e27243c60395e58665b9309280c8 (patch)
tree572b6226dad2c84621deb33d765d5a67454fc842 /src/widgets/notification.tsx
parentscss: make notifpopup shadow default (diff)
downloadcaelestia-shell-cf55e2613314e27243c60395e58665b9309280c8.tar.gz
caelestia-shell-cf55e2613314e27243c60395e58665b9309280c8.tar.bz2
caelestia-shell-cf55e2613314e27243c60395e58665b9309280c8.zip
config: use config file
Config file at ~/.config/caelestia/shell.json
Diffstat (limited to 'src/widgets/notification.tsx')
-rw-r--r--src/widgets/notification.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/notification.tsx b/src/widgets/notification.tsx
index 6f67b78..10f2076 100644
--- a/src/widgets/notification.tsx
+++ b/src/widgets/notification.tsx
@@ -20,7 +20,7 @@ const getTime = (time: number) => {
const now = GLib.DateTime.new_now_local();
const todayDay = now.get_day_of_year();
- if (config.agoTime) {
+ if (config.agoTime.get()) {
const diff = now.difference(messageTime) / 1e6;
if (diff < 60) return "Now";
if (diff < 3600) {
@@ -75,6 +75,7 @@ export default class Notification extends Widget.Box {
super({ className: "notification" });
const time = Variable(getTime(notification.time)).poll(60000, () => getTime(notification.time));
+ this.hook(config.agoTime, () => time.set(getTime(notification.time)));
this.#revealer = (
<revealer
@@ -138,7 +139,7 @@ export default class Notification extends Widget.Box {
});
// Close popup after timeout if transient or expire enabled in config
- if (popup && (config.expire || notification.transient))
+ if (popup && (config.expire.get() || notification.transient))
timeout(
notification.expireTimeout > 0
? notification.expireTimeout