summaryrefslogtreecommitdiff
path: root/src/services/updates.ts
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-22 20:35:20 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-22 20:35:20 +1100
commit2d979684453659318daf794febafb0887a12fb50 (patch)
tree2fd8131c34bc59e50d001938fe29021732e520c8 /src/services/updates.ts
parentnotifpopups: close all popups when notifs open (diff)
downloadcaelestia-shell-2d979684453659318daf794febafb0887a12fb50.tar.gz
caelestia-shell-2d979684453659318daf794febafb0887a12fb50.tar.bz2
caelestia-shell-2d979684453659318daf794febafb0887a12fb50.zip
config: dynamic service confs
Diffstat (limited to 'src/services/updates.ts')
-rw-r--r--src/services/updates.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/services/updates.ts b/src/services/updates.ts
index 9c4abe1..06e86b1 100644
--- a/src/services/updates.ts
+++ b/src/services/updates.ts
@@ -151,7 +151,7 @@ export default class Updates extends GObject.Object {
this.notify("loading");
this.#timeout?.destroy();
- this.#timeout = setTimeout(() => this.getUpdates(), config.interval);
+ this.#timeout = setTimeout(() => this.getUpdates(), config.interval.get());
})
.catch(console.error);
}
@@ -164,5 +164,10 @@ export default class Updates extends GObject.Object {
writeFileAsync(this.#cachePath, JSON.stringify(this.#data)).catch(console.error)
);
this.getUpdates();
+
+ config.interval.subscribe(i => {
+ this.#timeout?.destroy();
+ this.#timeout = setTimeout(() => this.getUpdates(), i);
+ });
}
}