summaryrefslogtreecommitdiff
path: root/src/services/updates.ts
diff options
context:
space:
mode:
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);
+ });
}
}